I have successfully implemented object detection from video using YOLO v3 model from OpenCV 4.0.0.21. It is running successfully on a local machine, so I wanted to test it on a Google Cloud Platform instance.
I've cloned my project, built OpenCV from source and launched YOLO v3 object detection. Though, this time I've caught an exception on the Darknet initialization step:
net = cv2.dnn.readNetFromDarknet(cfg_path, weights_path)
Here is also the traceback:
Traceback (most recent call last):
File "/home/username/path_to_app/yolo_object_detection.py",
line 21, in run_detection:
net = cv2.dnn.readNetFromDarknet(cfg_path, weights_path)
cv2.error: OpenCV(4.0.0) /home/username/opencv-
4.0.0/modules/dnn/src/darknet/darknet_io.cpp:690:
error: (-213:The function/feature is not implemented)
Transpose the weights (except for convolutional)
is not implemented in function 'ReadDarknetFromWeightsStream'
What is the reason and how can I overcome this exception?
I am not completely sure but looks like the yolov3.weights file is not getting stored correctly on Github(reason maybe its over 100MB). But getting a different weights file worked for me:
!wget "https://pjreddie.com/media/files/yolov3.weights"
Reference: https://colab.research.google.com/drive/1EjN6PrqXABZApL2GmlegOeLhhwmtWrlJ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With