{"id":28561963,"url":"https://github.com/hilbertcube/darknet-yolov4-cpp","last_synced_at":"2026-02-12T21:32:12.705Z","repository":{"id":272437612,"uuid":"916583435","full_name":"hilbertcube/darknet-YOLOv4-cpp","owner":"hilbertcube","description":"Darknet YOLOv4 C++ command-line wrapper with OpenCV-cpp and CUDA cmake setup","archived":false,"fork":false,"pushed_at":"2025-01-17T09:40:24.000Z","size":1378,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T11:52:52.135Z","etag":null,"topics":["darknet","opencv-dnn","yolov4"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hilbertcube.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-14T11:36:47.000Z","updated_at":"2025-03-26T18:10:09.000Z","dependencies_parsed_at":"2025-05-19T07:22:38.560Z","dependency_job_id":null,"html_url":"https://github.com/hilbertcube/darknet-YOLOv4-cpp","commit_stats":null,"previous_names":["continuum3416/darknet-yolov4-cpp","hilbertcube/darknet-yolov4-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hilbertcube/darknet-YOLOv4-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbertcube%2Fdarknet-YOLOv4-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbertcube%2Fdarknet-YOLOv4-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbertcube%2Fdarknet-YOLOv4-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbertcube%2Fdarknet-YOLOv4-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hilbertcube","download_url":"https://codeload.github.com/hilbertcube/darknet-YOLOv4-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbertcube%2Fdarknet-YOLOv4-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29381770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T20:34:40.886Z","status":"ssl_error","status_checked_at":"2026-02-12T20:23:00.490Z","response_time":55,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["darknet","opencv-dnn","yolov4"],"created_at":"2025-06-10T11:40:35.425Z","updated_at":"2026-02-12T21:32:12.691Z","avatar_url":"https://github.com/hilbertcube.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Darknet YOLOv4 C++ command-line wrapper with OpenCV-cpp and CUDA\r\n\r\nMinimum requirements: C++17\r\n\r\n#### Lists of command lines:\r\n\r\n- Yolo v4 COCO - **image**: `./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights -thresh 0.25`\r\n- **Output coordinates** of objects: `./darknet detector test cfg/coco.data yolov4.cfg yolov4.weights -ext_output dog.jpg`\r\n- Yolo v4 COCO - **video**: `./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights -ext_output test.mp4`\r\n- Yolo v4 COCO - **WebCam 0**: `./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights -c 0`\r\n- Yolo v4 COCO for **net-videocam** - Smart WebCam: `./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights http://192.168.0.80:8080/video?dummy=param.mjpg`\r\n- Yolo v4 - **save result videofile res.avi**: `./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights test.mp4 -out_filename res.avi`\r\n- Yolo v3 **Tiny** COCO - video: `./darknet detector demo cfg/coco.data cfg/yolov3-tiny.cfg yolov3-tiny.weights test.mp4`\r\n- **JSON and MJPEG server** that allows multiple connections from your soft or Web-browser `ip-address:8070` and 8090: `./darknet detector demo ./cfg/coco.data ./cfg/yolov3.cfg ./yolov3.weights test50.mp4 -json_port 8070 -mjpeg_port 8090 -ext_output`\r\n- Yolo v3 Tiny **on GPU #1**: `./darknet detector demo cfg/coco.data cfg/yolov3-tiny.cfg yolov3-tiny.weights -i 1 test.mp4`\r\n- Alternative method Yolo v3 COCO - image: `./darknet detect cfg/yolov4.cfg yolov4.weights -i 0 -thresh 0.25`\r\n- Train on **Amazon EC2**, to see mAP \u0026 Loss-chart using URL like: `http://ec2-35-160-228-91.us-west-2.compute.amazonaws.com:8090` in the Chrome/Firefox (**Darknet should be compiled with OpenCV**):\r\n    `./darknet detector train cfg/coco.data yolov4.cfg yolov4.conv.137 -dont_show -mjpeg_port 8090 -map`\r\n- 186 MB Yolo9000 - image: `./darknet detector test cfg/combine9k.data cfg/yolo9000.cfg yolo9000.weights`\r\n- Remember to put data/9k.tree and data/coco9k.map under the same folder of your app if you use the cpp api to build an app\r\n- To process a list of images `data/train.txt` and save results of detection to `result.json` file use:\r\n    `./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights -ext_output -dont_show -out result.json \u003c data/train.txt`\r\n- To process a list of images `data/train.txt` and save results of detection to `result.txt` use:\r\n    `./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights -dont_show -ext_output \u003c data/train.txt \u003e result.txt`\r\n- To process a video and output results to a json file use: `darknet.exe detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights file.mp4 -dont_show -json_file_output results.json`\r\n- Pseudo-labelling - to process a list of images `data/new_train.txt` and save results of detection in Yolo training format for each image as label `\u003cimage_name\u003e.txt` (in this way you can increase the amount of training data) use:\r\n    `./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights -thresh 0.25 -dont_show -save_labels \u003c data/new_train.txt`\r\n- To calculate anchors: `./darknet detector calc_anchors data/obj.data -num_of_clusters 9 -width 416 -height 416`\r\n- To check accuracy mAP@IoU=50: `./darknet detector map data/obj.data yolo-obj.cfg backup\\yolo-obj_7000.weights`\r\n- To check accuracy mAP@IoU=75: `./darknet detector map data/obj.data yolo-obj.cfg backup\\yolo-obj_7000.weights -iou_thresh 0.75`\r\n\r\n#### To run the wrapper,\r\nGo to the src folder, which contains some codes at webcam.cpp and simply run\r\n```\r\ng++ webcam.cpp -o ./bin/webcam.exe; ./bin/webcam.exe\r\n```\r\nor if you use OpenCV, build the folder with CMake and run\r\n```\r\ncmake --build .\\build\\ --config Debug; .\\build\\Debug\\webcam.exe\r\n\r\n# or,\r\n\r\ncmake --build .\\build\\ --config Release; .\\build\\Release\\webcam.exe\r\n```\r\n#### on Linux, \r\nyou still have to specify the C++ version in your .json setting file, and to run, use\r\n```\r\ng++ -std=c++17 webcam.cpp -o ./bin/webcam; ./bin/webcam\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhilbertcube%2Fdarknet-yolov4-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhilbertcube%2Fdarknet-yolov4-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhilbertcube%2Fdarknet-yolov4-cpp/lists"}