GithubHelp home page GithubHelp logo

super-dainiu / yolov3 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 34.34 MB

Midterm of DATA130051 Computer Vision

License: Apache License 2.0

Python 100.00%
darknet object-detection pytorch yolo yolov3

yolov3's Introduction

YOLOv3 from scratch

This is the mid-term project for DATA130051 Computer Vision. ๐Ÿฎ๐Ÿฎ๐Ÿฎ

Full report <here>.

YOLOv3 ๐Ÿš€ is an open-source object detection architecture first proposed by Joseph Redmon[1]. I managed to reproduce the network from scratch with the help of Aladdin Persson[2] and his excellent video tutorials[3]. ๐Ÿคณ Basically, I reimplemented YOLOv3 model as well as the utils and metrics for detections. Also, a detector class was written to provide a shortcut for video detections. Again, thanks a lot for those who contribute to this open-source society! ๐Ÿค—

Quick Start ๐ŸŒŸ

Install ๐Ÿ˜Ž

Python>=3.6.0 is required with all requirements.txt installed including PyTorch>=1.9.0:

git clone https://github.com/super-dainiu/yolov3
cd yolov3
pip install -r requirements.txt

Download weights ๐Ÿคช

Please follow the guide in ./pretrained directory.

Download dataset ๐Ÿฅต

Please follow the guide in ./PASCAL_VOC directory. Again credit to Aladdin Persson[2] for his excellent tutorial. ๐Ÿ‘

Inference ๐Ÿ‘พ

After downloading the weights, you can do detection for images, gifs, or mp4 using main.py.

usage: main.py [-h] --weights WEIGHTS [--save SAVE] [--save_dir SAVE_DIR] [--conf_thres CONF_THRES] [--iou_thres IOU_THRES] [--max_det MAX_DET] [--target TARGET [TARGET ...]] [--camera CAMERA] [--samples SAMPLES [SAMPLES ...]]

Use YOLOv3

optional arguments:

-h, --help show this help message and exit

--weights WEIGHTS Weight directory

--save SAVE Save results

--save_dir SAVE_DIR Save directory

--conf_thres CONF_THRES Confidence threshold

--iou_thres IOU_THRES IOU threshold

--max_det MAX_DET Maximum detection per frame

--target TARGET [TARGET ...] Targets (i.e. person), * for all classes

--camera CAMERA Use your camera

--samples SAMPLES [SAMPLES ...] Sample images (ends with .jpg, .png, .gif, .mp4)

You might do a simple detection with the following bash command.

python main.py --weights pretrained/yolov3.pth.tar --sample samples/video.mp4 samples/image_1.jpg samples/image_2.png samples/gif_1.gif --save True --save-dir outputs --target person car --conf_thres 0.7 --iou_thres 0.3 --max_det 10

Or activate your camera for detection.

python main.py --weights pretrained/yolov3.pth.tar --camera True

Results ๐Ÿ™€

PASCAL VOC metrics (mAP at .5 IOU) ๐ŸŒŸ

Class mAP
aeroplane 58.018
bicycle 60.933
bird 34.835
boat 32.412
bottle 17.423
bus 63.038
car 69.853
cat 57.547
chair 29.547
cow 44.667
diningtable 48.446
dog 48.934
horse 59.299
motorbike 63.281
person 52.751
pottedplant 19.121
sheep 48.951
sofa 51.492
train 56.918
tvmonitor 55.288
TOTAL mAP 48.638

Example Outputs ๐Ÿ’ฉ

Transformer
CR7 Celebration
Maguire and Lingod
The dog
The cat
Car

yolov3's People

Contributors

super-dainiu avatar

Watchers

 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.