{"id":19226006,"url":"https://github.com/developer239/yolo-cmake-opencv-onnx-cpp","last_synced_at":"2025-04-10T22:53:40.021Z","repository":{"id":97424849,"uuid":"543127230","full_name":"developer239/yolo-cmake-opencv-onnx-cpp","owner":"developer239","description":"Use YOLO with your favorite language and computer vision library. This example includes ONNX runtime for better weights support.","archived":false,"fork":false,"pushed_at":"2023-06-15T16:24:18.000Z","size":91164,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T22:53:24.667Z","etag":null,"topics":["cmake","cpp","macos","onnx","onnxruntime","opencv","windows","yolov5","yolov7"],"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/developer239.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}},"created_at":"2022-09-29T13:05:39.000Z","updated_at":"2023-11-29T06:17:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7873161-a932-4030-b996-ae67d3dc4f4d","html_url":"https://github.com/developer239/yolo-cmake-opencv-onnx-cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fyolo-cmake-opencv-onnx-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fyolo-cmake-opencv-onnx-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fyolo-cmake-opencv-onnx-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fyolo-cmake-opencv-onnx-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developer239","download_url":"https://codeload.github.com/developer239/yolo-cmake-opencv-onnx-cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312172,"owners_count":21082638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cmake","cpp","macos","onnx","onnxruntime","opencv","windows","yolov5","yolov7"],"created_at":"2024-11-09T15:17:02.364Z","updated_at":"2025-04-10T22:53:40.010Z","avatar_url":"https://github.com/developer239.png","language":"C++","readme":"# YOLO CMake OpenCV ONNX CPP\n\n![master](https://github.com/developer239/yolo-cmake-opencv-onnx-cpp/actions/workflows/ci.yml/badge.svg)\n\nObject detection implementation is inspired\nby [hpc203/yolov7-opencv-onnxrun-cpp-py](https://github.com/hpc203/yolov7-opencv-onnxrun-cpp-py)\n\nThis repository serves mostly as documentation for my personal use, demonstrating how to use ONNX and OpenCV with CMake\non MacOS.\n\n## MacOS installation\n\n1) Install dependencies:\n\n```bash\n$ brew install cmake\n$ brew install onnxruntime \n$ brew install opencv\n```\n\n2) If you are on ARM then you are good to go 🎉\n\n3) **If you are not using an ARM processor**, [download correct runtime 1.12.1 header files from the official GitHub repository](https://github.com/microsoft/onnxruntime/releases/tag/v1.12.1).\n\n4) Put onnxruntime files to `external/`\n\n5) Set `ONNXRUNTIME_ROOT` env variable to your onnxruntime folder name\n\n## Windows installation\n\n1) Install dependencies:\n\n```bash\n$ choco install cmake --pre\n$ choco install opencv\n```\n\n2) Download [ONNX Runtime 1.12.1](https://github.com/microsoft/onnxruntime/releases/download/v1.12.1/onnxruntime-win-x64-1.12.1.zip)\n3) Extract and put onnxruntime folder to `external/onnxruntime-win-x64-1.12.1`\n\n## Model\n\n- This example utilizes a custom-trained model. If you wish to train your own model, you can create a dataset\n  using [Roboflow](https://roboflow.com/#annotate) and then use one of\n  their [official notebooks](https://github.com/roboflow/notebooks) to perform the training. There are also many\n  comprehensive tutorials in the official [ultralytics/yolov5 repository](https://github.com/ultralytics/yolov5)\n- You are free to use any model you prefer, but be sure to update the `class.names` file accordingly. Additionally, for instance segmentation, it is important to pass `SegNetConfig` with proper parameters.\n\n## Preview\n\n100 epochs. Trained on YOLOv5n-640 models. Inference on M1 CPU takes ~40ms.\n\n**Object detection dataset information:**\n- 186 training images\n- 57 validation images\n- 25 test images\n\n**Instance segmentation dataset information:**\n\n- 540 training images (AUGMENTATION rotation: Between -15° and +15°)\n- 53 validation images\n- 28 test images\n\n![preview-detection-1](docs/preview-detection-1.png)\n![preview-segmentation-1](docs/preview-segmentation-1.2.png)\n\n![preview-detection-2](docs/preview-detection-2.png)\n![preview-segmentation-2](docs/preview-segmentation-2.2.png)\n\n![preview-detection-3](docs/preview-detection-3.png)\n![preview-segmentation-3](docs/preview-segmentation-3.2.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper239%2Fyolo-cmake-opencv-onnx-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper239%2Fyolo-cmake-opencv-onnx-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper239%2Fyolo-cmake-opencv-onnx-cpp/lists"}