【发布时间】:2021-02-14 03:54:48
【问题描述】:
我正在使用 YOLOv4 在 Colab 上训练对象检测模型。这是我用来在测试集上运行测试的方法:
#/test has images that we can test our detector on
test_folder = "/content/logorec/Worlds-2020-Logos/"
test_images = [f for f in os.listdir(test_folder) if f.endswith('.png')]
import random
img_path = ''
for i in range(0, len(test_images)):
img_path = test_folder + test_images[i];
!./darknet detect cfg/custom-yolov4-detector.cfg backup/custom-yolov4-detector_last.weights {img_path} -dont-show
imShow('predictions.jpg')
如您所见,问题在于它一次测试 1 个文件。对于非常大的测试集,这是非常低效的。有没有办法可以批量(同时)而不是顺序地运行推理?我目前可以使用 Tesla V100 GPU。
【问题讨论】:
标签: python tensorflow computer-vision object-detection yolo