"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

October 29, 2019

Day #290 - Yolo from OpenCV DNN - Windows 10

OpenCV has examples to invoke Deep Network using readNet modules

Key Methods
  • cv.dnn.readNet - Load the network
  • cv.dnn.NMSBoxes - Non Max Suppression
  • cv.dnn.blobFromImage - Input for Deep Network
Steps

Package Install - pip install opencv-python
Step #1 - git clone https://github.com/opencv/opencv
Step #2 - Goto Path - opencv/opencv/tree/master/samples/dnn
Link https://docs.opencv.org/master/da/d9d/tutorial_dnn_yolo.html
Step #3 - Steps to Run
example_dnn_object_detection --config=[PATH-TO-DARKNET]/cfg/yolo.cfg --model=[PATH-TO-DARKNET]/yolo.weights --classes=object_detection_classes_pascal_voc.txt --width=416 --height=416 --scale=0.00392 --input=[PATH-TO-IMAGE-OR-VIDEO-FILE] --rgb
Step #4 - cd E:\Code_Repo\opencv\samples\dnn
Step #5 - For Image
python object_detection.py --config="E:\\Code_Repo\\darkflow\\cfg\\yolo.cfg" --model="E:\\Code_Repo\\darkflow\\yolov2.weights" --classes="E:\\Code_Repo\\darkflow\\cfg\\coco.names" --width=416 --height=416 --scale=0.00392 --input="E:\Car_Detection\Data1\\frame214000.jpg" --rgb
Step #6 - For Video
python object_detection.py --config="E:\\Code_Repo\\darkflow\\cfg\\yolo.cfg" --model="E:\\Code_Repo\\darkflow\\yolov2.weights" --classes="E:\\Code_Repo\\darkflow\\cfg\\coco.names" --width=416 --height=416 --scale=0.00392 --input="E:\Car_Detection\\ch10_20190304115220.mp4" --rgb
Another Good Ref - https://github.com/rdeepc/ExploreOpencvDnn
Results




Happy Learning!!!

No comments: