Difference between revisions of "YOLO"

From Interaction Station Wiki
Jump to navigation Jump to search
Line 19: Line 19:
  
 
=== Installing Darknet  (GPU + OpenCV)  ===
 
=== Installing Darknet  (GPU + OpenCV)  ===
 +
*In our forked version of the original repository, the GPU & OPENCV flags in the Makefile have already been set to 1, and the darknet/examples/rnn.c has been modified for being able to save the generate your own model. So we only need to do:
 +
 
  git clone https://github.com/mywdka/darknet.git
 
  git clone https://github.com/mywdka/darknet.git
 
  cd darknet
 
  cd darknet
nano Makefile
 
 
*Set these flags to 1 and save:
 
GPU=1 <br/>
 
OPENCV=1
 
 
*Replace the file rnn.c in darknet/examples with this one:
 
 
And the last step:
 
 
 
  make
 
  make
 
  
 
*Guide:
 
*Guide:

Revision as of 22:21, 4 January 2019

Installation

  • Fist, we install OpenCV:

OpenCV installation in Ubuntu 16.04

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python2.7-dev python3.5-dev


Installing Darknet (GPU + OpenCV)

  • In our forked version of the original repository, the GPU & OPENCV flags in the Makefile have already been set to 1, and the darknet/examples/rnn.c has been modified for being able to save the generate your own model. So we only need to do:
git clone https://github.com/mywdka/darknet.git
cd darknet
make

Using YOLO with Darknet (GPU + OpenCV). Tested on Ubuntu 16.04

  • Download the weights:
wget https://pjreddie.com/media/files/yolov3.weights
  • Go to the directory:
cd darknet
  • Run the detector (image):
./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg
  • Run the detector (video):
./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights <video file>
  • Run the detector (webcam):
./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights