pytorch-yolo-v3
pytorch-yolo-v3 copied to clipboard
Would you please test code about single image testing?
batch = prep_image(image, inp_dim)[0].cuda()
with torch.no_grad():
prediction = model(Variable(batch), True)
prediction = write_results(prediction, confidence, num_classes, nms=True, nms_conf=nms_thesh)
objs = [classes[int(x[-1])] for x in prediction]
print("{0:20s} {1:s}".format("Objects Detected:", " ".join(objs)))
torch.cuda.synchronize()