Coder Social home page Coder Social logo

madhawav / yolo3-4-py Goto Github PK

View Code? Open in Web Editor NEW
515.0 24.0 166.0 6.07 MB

A Python wrapper on Darknet. Compatible with YOLO V3.

License: Apache License 2.0

C++ 2.50% Shell 8.91% Python 61.75% Dockerfile 2.12% C 4.52% Cython 20.19%
yolov3 yolo python3 cython python-wrapper darknet object-detection yolo3

yolo3-4-py's Introduction

YOLO3-4-Py

PyPI Badge PyPI Badge Build Status

A Python wrapper on Darknet. Compatible with latest YOLO V3. YOLO 3.0 is an Object Detector by pjreddie.

OutputImage Image source: http://absfreepic.com/free-photos/download/crowded-cars-on-street-4032x2272_48736.html

Google Colab Demo

Refer the following link to preview YOLO3-4-Py in Google Colab: [Google Colab].

Copy the notebook to your drive and run all cells. Ensure that you are in a GPU runtime. You can change the runtime by accessing the menu Runtime/Change runtime type.

What's New?

  • 2021-02-27 - Fixed the pkg-config related issue affecting some users of Ubuntu 20.04 and later.
  • 2020-06-18 - Added a sample Google Colab notebook demonstrating functionality.
  • 2019-01-15 - Added nvidia-docker support.
  • 2018-08-04 - Option to select the preferred GPU - pydarknet.set_cuda_device(GPU_INDEX)
  • 2018-04-23 - PyPI Release of RC12

Pre-requisites

  1. Python 3.5+
  2. Python3-Dev (For Ubuntu, sudo apt-get install python3-dev)
  3. Numpy pip3 install numpy
  4. Cython pip3 install cython
  5. Optionally, OpenCV 3.x with Python bindings. (Tested on OpenCV 3.4.0)
    • You can use this script to automate Open CV 3.4 installation (Tested on Ubuntu 16.04).
    • Performance of this approach is better than not using OpenCV.
    • Installations from PyPI distributions does not use OpenCV.
NOTE: OpenCV 3.4.1 has a bug which causes Darknet to fail. Therefore this wrapper would not work with OpenCV 3.4.1.
More details are available at https://github.com/pjreddie/darknet/issues/502

Installation

Installation from PyPI distribution (as described below) is the most convenient approach if you intend to use yolo34py for your projects.

Installation of CPU Only Version

python3 -m pip install yolo34py

Installation of GPU Accelerated Version

python3 -m pip install yolo34py-gpu
NOTE: PyPI Deployments does not use OpenCV due to complexity involved in installation. 
To get best performance, it is recommended to install from source with OpenCV enabled.
NOTE: Make sure CUDA_HOME environment variable is set.

How to run demos in local machine?

  1. If you have not installed already, run python3 setup.py build_ext --inplace to install library locally.
  2. Download "yolov3" model file and config files using sh download_models.sh.
  3. Run python3 webcam_demo.py, python3 video_demo.py or python3 image_demo.py

How to run demo using docker?

  1. Navigate to docker directory.
  2. Copy sample images into the input directory. Or else run input/download_sample_images.sh
  3. Run sh run.sh or sh run-gpu.sh
  4. Observe the outputs generated in output directory.
GPU Version requires nvidia-docker

Installation from Source

  1. Set environment variables
  • To enable GPU acceleration, export GPU=1.
  • To enable OpenCV, export OPENCV=1
  1. Navigate to ./src and run pip3 install . to install library.

Using a custom version of Darknet

  1. Set environment variable DARKNET_HOME to download location of darknet.
  2. Add DARKNET_HOME to LD_LIBRARY_PATH. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DARKNET_HOME
  3. Continue instructions for installation from source.

Having trouble?

Kindly raise your issues in the issues section of GitHub repository.

Like to contribute?

Feel free to send PRs or discuss on possible future improvements in issues section. Your contributions are most welcome!

Looking for YOLO v4?

https://github.com/AlexeyAB/darknet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.