Key Methods
- cv.dnn.readNet - Load the network
- cv.dnn.NMSBoxes - Non Max Suppression
- cv.dnn.blobFromImage - Input for Deep Network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Happy Learning!!!
No comments:
Post a Comment