Giter Site home page Giter Site logo

tiantuxu / darknet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pjreddie/darknet

0.0 2.0 0.0 9.34 MB

YOLOv3 & YOLOv2 that is optimized for running object detection on consecutive video frames

Home Page: http://pjreddie.com/darknet/

License: Other

Makefile 0.30% Python 3.43% C 79.79% Shell 0.13% Cuda 11.44% C++ 4.87% Batchfile 0.01% Objective-C 0.03%

darknet's Introduction

YOLOv2 & YOLOv3 for Consecutive Video Streams

Requiremets:

Build

$ export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}} 
$ export LD_LIBRARY_PATH=/usr/local/cuda8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
$ make

Get YOLO weights

Download YOLOv2 or YOLOv3 weights

Video Preparation

Preparing Videos and decode to images: Transcode to 608x608 & Take out 10 min video sample (Optional)

$ ffmpeg -c:v h264_cuvid -i input.mp4 -ss 00:00:00 -t 00:10:00 -vf scale=608:608 -c:v h264_nvenc output.mp4

Image Generation

Decode and save as images, with filenames defined in frame sequences

$ ffmpeg -i input.mp4 ./path/to/images/%7d.jpg 

Generate filename lists, and the text file will be in ./data/train.txt; Remember to change path to images in generate-name.py

$ python genearte-name.py

Run it!

Note: Can change to all availble cfg under./cfg

$ ./darknet detector test cfg/imagenet22k.dataset cfg/yolov3.cfg yolov3.weights -dont_show -ext_output < ./images.txt > result.txt

Inference results is in result.txt

/path/to/image/0000000.jpg,OB1,97% (left_x:  xxx   top_y:  xxx   width:  xxx   height:  xxx)
/path/to/image/0000000.jpg,OB2,90% (left_x:  xxx   top_y:  xxx   width:  xxx   height:  xxx)
/path/to/image/0000001.jpg,OB2,88% (left_x:  xxx   top_y:  xxx   width:  xxx   height:  xxx)
/path/to/image/0000003.jpg,OB3,96% (left_x:  xxx   top_y:  xxx   width:  xxx   height:  xxx)
/path/to/image/0000005.jpg,OB4,89% (left_x:  xxx   top_y:  xxx   width:  xxx   height:  xxx)
...

darknet's People

Contributors

pjreddie avatar tiantuxu avatar tjluyao avatar alexey-kamenev avatar lilohuang avatar agirbau avatar

Watchers

James Cloos avatar  avatar

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.