Skip to content

Instantly share code, notes, and snippets.

@f-rumblefish
Last active October 23, 2018 01:58
Show Gist options
  • Save f-rumblefish/b9888324cf53ecc9826ff45c8cf37884 to your computer and use it in GitHub Desktop.
Save f-rumblefish/b9888324cf53ecc9826ff45c8cf37884 to your computer and use it in GitHub Desktop.
Object Detection via YOLO
config = 'yolov2.cfg'
model = 'yolov2.weights'
Net_YOLO = cv.dnn.readNetFromDarknet(config, model)
Net_YOLO.setInput(cv.dnn.blobFromImage(img, 1.0/255.0, (416, 416), swapRB = True, crop = False))
Net_YOLO_pred = Net_YOLO.forward()
print(">>> YOLOv2 prediction shape = ", Net_YOLO_pred.shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment