Voltar ao ranking

ayooshkathuria/pytorch-yolo-v3

Python

A PyTorch implementation of the YOLO v3 object detection algorithm

yolov3yoloobject-detectionpytorch
Crescimento de estrelas
Estrelas
3.3k
Forks
1k
Crescimento semanal
Issues
99
1k2k3k
abr. de 2018jan. de 2021out. de 2023jul. de 2026
ArtefatosPyPIpip install pytorch-yolo-v3
README

A PyTorch implementation of a YOLO v3 Object Detector

[UPDATE] : This repo serves as a driver code for my research. I just graduated college, and am very busy looking for research internship / fellowship roles before eventually applying for a masters. I won't have the time to look into issues for the time being. Thank you.

This repository contains code for a object detector based on YOLOv3: An Incremental Improvement, implementedin PyTorch. The code is based on the official code of YOLO v3, as well as a PyTorch port of the original code, by marvis. One of the goals of this code is to improve upon the original port by removing redundant parts of the code (The official code is basically a fully blown deep learning library, and includes stuff like sequence models, which are not used in YOLO). I've also tried to keep the code minimal, and document it as well as I can.

Tutorial for building this detector from scratch

If you want to understand how to implement this detector by yourself from scratch, then you can go through this very detailed 5-part tutorial series I wrote on Paperspace. Perfect for someone who wants to move from beginner to intermediate pytorch skills.

Implement YOLO v3 from scratch

As of now, the code only contains the detection module, but you should expect the training module soon. :)

Requirements

  1. Python 3.5
  2. OpenCV
  3. PyTorch 0.4

Using PyTorch 0.3 will break the detector.

Detection Example

Detection Example

Running the detector

On single or multiple images

Clone, and cd into the repo directory. The first thing you need to do is to get the weights file This time around, for v3, authors has supplied a weightsfile only for COCO here, and place

the weights file into your repo directory. Or, you could just type (if you're on Linux)

wget https://pjreddie.com/media/files/yolov3.weights 
python detect.py --images imgs --det det 

--images flag defines the directory to load images from, or a single image file (it will figure it out), and --det is the directory to save images to. Other setting such as batch size (using --bs flag) , object threshold confidence can be tweaked with flags that can be looked up with.

python detect.py -h

Speed Accuracy Tradeoff

You can change the resolutions of the input image by the --reso flag. The default value is 416. Whatever value you chose, rememeber it should be a multiple of 32 and greater than 32. Weird things will happen if you don't. You've been warned.

python detect.py --images imgs --det det --reso 320

On Video

For this, you should run the file, video_demo.py with --video flag specifying the video file. The video file should be in .avi format since openCV only accepts OpenCV as the input format.

python video_demo.py --video video.avi

Tweakable settings can be seen with -h flag.

Speeding up Video Inference

To speed video inference, you can try using the video_demo_half.py file instead which does all the inference with 16-bit half precision floats instead of 32-bit float. I haven't seen big improvements, but I attribute that to having an older card (Tesla K80, Kepler arch). If you have one of cards with fast float16 support, try it out, and if possible, benchmark it.

On a Camera

Same as video module, but you don't have to specify the video file since feed will be taken from your camera. To be precise, feed will be taken from what the OpenCV, recognises as camera 0. The default image resolution is 160 here, though you can change it with reso flag.

python cam_demo.py

You can easily tweak the code to use different weightsfiles, available at yolo website

NOTE: The scales features has been disabled for better refactoring.

Detection across different scales

YOLO v3 makes detections across different scales, each of which deputise in detecting objects of different sizes depending upon whether they capture coarse features, fine grained features or something between. You can experiment with these scales by the --scales flag.

python detect.py --scales 1,3
Repositórios relacionados
ultralytics/yolov5

Ultralytics YOLOv5 in PyTorch > ONNX > CoreML > TFLite

PythonPyPIGNU Affero General Public License v3.0yolov3yolov5
docs.ultralytics.com
57.7k17.5k
PaddlePaddle/PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.

PythonPyPIApache License 2.0object-detectioninstance-segmentation
14.3k3k
WongKinYiu/yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors

Jupyter NotebookGNU General Public License v3.0scaled-yolov4yolor
14.1k4.4k
ultralytics/yolov3

Ultralytics YOLOv3 in PyTorch > ONNX > CoreML > TFLite

PythonPyPIGNU Affero General Public License v3.0yolov3object-detection
docs.ultralytics.com
10.6k3.4k
Megvii-BaseDetection/YOLOX

YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with MegEngine, ONNX, TensorRT, ncnn, and OpenVINO supported. Documentation: https://yolox.readthedocs.io/

PythonPyPIApache License 2.0yoloxyolov3
10.5k2.5k
wang-xinyu/tensorrtx

Implementation of popular deep learning networks with TensorRT network definition API

C++MIT Licensetensorrtmnasnet
7.8k1.9k
Tianxiaomo/pytorch-YOLOv4

PyTorch ,ONNX and TensorRT implementation of YOLOv4

PythonPyPIApache License 2.0yolov4pytorch
4.5k1.5k
YunYang1994/tensorflow-yolov3

🔥 TensorFlow Code for technical report: "YOLOv3: An Incremental Improvement"

PythonPyPIMIT Licenseyolov3tensorflow
yunyang1994.gitee.io/2018/12/28/YOLOv3-%E7%AE%97%E6%B3%95%E7%9A%84%E4%B8%80%E7%82%B9%E7%90%86%E8%A7%A3/
3.6k1.3k
ZQPei/deep_sort_pytorch

MOT using deepsort and yolov3 with pytorch

PythonPyPIMIT Licensedeepsortpytorch
3k726
iscyy/ultralyticsPro

🔥🔥🔥 专注于YOLO11,YOLOv8、TYOLOv12、YOLOv10、RT-DETR、YOLOv7、YOLOv5改进模型,Support to improve backbone, neck, head, loss, IoU, NMS and other modules🚀

PythonPyPIyolov5backbone
github.com/iscyy/ultralyticsPro
2.9k460
iscyy/yoloair

🔥🔥🔥 专注于YOLOv5,YOLOv7、YOLOv8、YOLOv9改进模型,Support to improve backbone, neck, head, loss, IoU, NMS and other modules🚀

PythonPyPIyolov5attention
github.com/iscyy/yoloair
2.6k438
zzh8829/yolov3-tf2

YoloV3 Implemented in Tensorflow 2.0

Jupyter NotebookMIT Licensetensorflowtf2
2.5k890