Skip to main content

Python wrapper on YOLO 3.0 implementation by 'pjreddie': (

Project description

A Python wrapper on pjreddie's implementation (authors' implementation) of YOLO V3 Object Detector on Darknet. Also compatible with other Darknet Object Detection models.

OutputImage Image source:


  • Python 3.5+
  • Linux x86-64 Operating System
  • nVidia CUDA SDK (for GPU version only. Make sure nvcc is available in PATH variable.)

Sample Usage

Note: This sample code requires OpenCV with python bindings installed. (pip3 install opencv-python==3.4.0)

  1. Create a directory to host sample code and navigate to it.
  2. Download and execute this script to download model files.
  3. Create with following code. Specify SAMPLE_INPUT_IMAGE.
    from pydarknet import Detector, Image
    import cv2
    net = Detector(bytes("cfg/yolov3.cfg", encoding="utf-8"), bytes("weights/yolov3.weights", encoding="utf-8"), 0, bytes("cfg/",encoding="utf-8"))
    img = cv2.imread('SAMPLE_INPUT_IMAGE')
    img_darknet = Image(img)
    results = net.detect(img_darknet)
    for cat, score, bounds in results:
        x, y, w, h = bounds
        cv2.rectangle(img, (int(x - w / 2), int(y - h / 2)), (int(x + w / 2), int(y + h / 2)), (255, 0, 0), thickness=2)
    cv2.imshow("output", img)
  4. Execute python


yolo34py comes in 2 variants, CPU Only Version and GPU Version. Installation may take a while since it involves downloading and compiling of darknet.

CPU Only Version

This version is configured on darknet compiled with flag GPU = 0.

pip3 install numpy
pip3 install yolo34py

GPU Version:

This version is configured on darknet compiled with flag GPU = 1.

pip3 install numpy
pip3 install yolo34py-gpu

More Information


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for yolo34py-gpu, version 0.1rc12
Filename, size File type Python version Upload date Hashes
Filename, size yolo34py-gpu-0.1rc12.tar.gz (66.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page