{"id":19146253,"url":"https://github.com/prodeveloper0/pydarknet","last_synced_at":"2025-09-18T13:23:43.368Z","repository":{"id":240418393,"uuid":"430024451","full_name":"prodeveloper0/pyDarknet","owner":"prodeveloper0","description":"Darknet written by AlexeyAB Python Wrapper","archived":false,"fork":false,"pushed_at":"2021-12-06T02:17:24.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T19:49:14.031Z","etag":null,"topics":["darknet","python","yolo","yolov4"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prodeveloper0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-11-20T06:12:19.000Z","updated_at":"2025-01-30T01:25:21.000Z","dependencies_parsed_at":"2024-05-18T18:53:52.732Z","dependency_job_id":null,"html_url":"https://github.com/prodeveloper0/pyDarknet","commit_stats":null,"previous_names":["prodeveloper0/pydarknet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prodeveloper0/pyDarknet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodeveloper0%2FpyDarknet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodeveloper0%2FpyDarknet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodeveloper0%2FpyDarknet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodeveloper0%2FpyDarknet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prodeveloper0","download_url":"https://codeload.github.com/prodeveloper0/pyDarknet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prodeveloper0%2FpyDarknet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275772858,"owners_count":25525909,"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","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","python","yolo","yolov4"],"created_at":"2024-11-09T07:43:41.674Z","updated_at":"2025-09-18T13:23:43.330Z","avatar_url":"https://github.com/prodeveloper0.png","language":"Python","readme":"# pyDarknet\nThis is Python wrapper library for Darknet which is a deep neural network framework by AlexeyAB running YOLO object detector.\n\nThis is implemented by `ctypes` and you can use complied shared library file (`libdark.so` / `darknet.dll`) on Darknet directely in you Python project.\n\n# Requirements\n* opencv-python\n\n```bash\npip install -r requirements.txt\n```\n\n# Usages\n## How to import `pyDarknet` on your project.\n1. Copy compiled shared library file to on your project.\n2. Rename the shared library file `libdarknet-gpu.so` or `libdarknet.so`.\n     * pyDarknet selects `libdarknet-gpu.so` supporting GPU acceleration first. If there's no library surpoting GPU acceleration, pyDarknet select `libdarknet.so` alternatively.  \n    * pyDarknet can detect shared library extensions by operating systems.  \n    e.g.) `libdarknet.so` is for Linux, `libdarknet.dll` is for Windows.\n3. Just import `pydarknet` package on your project.\n    ```python\n    import pydarknet\n    ```\n## How to load `YOLOv4` by `pyDarknet`.\nIt's simple. Just create a `Detector`.\n```python\ndetector = pydarknet.Detector('yolov4.cfg', 'yolov4.weights', 'coco.names')\n```\n`cfg_filename` and `weights_filename` assigned as each `yolov4.cfg` and `yolov4.weights` must be filled. On the other hand, `names_filename` assigned as `coco.names` can be keep empty by passing `None`.\n\n## How to detect objects by `YOLOv4` created by `pyDarknet`.\n1. Prepare or load image.  \n    * The input must have **HWC** shape.  \n    * The input must be 3 channel BGR (**NOT RGB**) image commonly used in OpenCV.  \n\n    If you are using OpenCV mainly, you can use ```cv2.imread``` / ```cv2.imdecode```.  \n    ```python\n    import cv2\n    img = cv2.imread('image.png', cv2.IMREAD_COLOR)\n    ```  \n2. Call `detect` method in `Detector`.  \n    ```python\n    bboxes = detector.detect(img)\n    ```\n    `detect` method has `obj_thres`, `hier_thresh`, `nms_thresh` and `obj_filter`.  \n    Three threshold paramaters having a posfix as `_thresh` are object detection paramaters. You can refence original paper or repository.  \n\n    `obj_filter` is an option filtering bounding boxes you want by object names. It is must be list of object names or indices.  \n    ```python\n    detector.detect(..., obj_filter=['car', 'bus'])\n    ```\n    or\n    ```python\n    detector.detect(..., obj_filter['1', '2'])\n    ```\n\n## Results of Detector\nThe detector returns list of tuples like `(name, prob, gebox)`.  \n```python\nfor name, prob, geobox in bboxes:\n    x, y, w, h = geobox\n```\n_What is `geobox`? To distinguish a **bounding box** including both **name** and **geometry informations** on image and a box including only **geometry informations** on image. I called the latter `geobox`._\n\n`name` is detected object name defined in `.names` file. if you not set `.names` file in the detector, `name` is object index (_NOT A **NUMBER**, BUT A **STRING** PRESENTATION NUMBER_) defined in the model.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprodeveloper0%2Fpydarknet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprodeveloper0%2Fpydarknet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprodeveloper0%2Fpydarknet/lists"}