YOLOv3-PyTorch
Contents
Introduction
This repository contains an op-for-op PyTorch reimplementation of YOLOv3: An Incremental Improvement.
Getting Started
Requirements
- Python 3.10+
- PyTorch 2.0.0+
- CUDA 11.8+
- Ubuntu 22.04+
From PyPI
pip install yolov3_pytorch -i https://pypi.org/simple
Local Install
git clone https://github.com/Lornatang/YOLOv3-PyTorch.git
cd YOLOv3-PyTorch
pip install -r requirements.txt
pip install -e .
All pretrained model weights
Inference
# Download pretrained model weights to `./results/pretrained_models`
wget https://github.com/Lornatang/YOLOv3-PyTorch/releases/download/0.1.5/YOLOv3_Tiny-COCO-20231107.pth.tar -O ./results/pretrained_models/YOLOv3_Tiny-COCO-20231107.pth.tar
python ./tools/inference.py ./data/examples/dog.jpg
# Loaded `./results/pretrained_models/YOLOv3_Tiny-COCO-20231107.pth.tar` models weights successfully.
# image 1/1 ./data/examples/dog.jpg: 320x416 1 bicycle, 2 car, 1 dog,
# See ./results/inference/dog.jpg for visualization.
Test
# Download dataset to `./data`
cd ./scripts
bash ./process_voc0712_dataset.sh
cd ..
# Download pretrained model weights to `./results/pretrained_models`
wget https://github.com/Lornatang/YOLOv3-PyTorch/releases/download/0.1.5/YOLOv3_Tiny-VOC-20231107.pth.tar -O ./results/pretrained_models/YOLOv3_Tiny-VOC-20231107.pth.tar
python ./tools/eval.py ./configs/VOC-Detection/yolov3_tiny.yaml
Results
COCO Object Detection
VOC Object Detection
Train
VOC
# Download dataset to `./data`
cd ./scripts
bash ./process_voc0712_dataset.sh
cd ..
# Download pretrained model weights to `./results/pretrained_models`
wget https://github.com/Lornatang/YOLOv3-PyTorch/releases/download/0.1.5/YOLOv3_Tiny-VOC-20231107.pth.tar -O ./results/pretrained_models/YOLOv3_Tiny-VOC-20231107.pth.tar
# change WEIGHTS_PATH in ./configs/VOC-Detection/yolov3_tiny.yaml
python ./tools/train.py ./configs/VOC-Detection/yolov3_tiny.yaml
COCO
# COCO2014
# Download dataset to `./data`
cd ./scripts
bash ./process_coco2014_dataset.sh
cd ..
# Download pretrained model weights to `./results/pretrained_models`
wget https://github.com/Lornatang/YOLOv3-PyTorch/releases/download/0.1.5/YOLOv3_Tiny-COCO-20231107.pth.tar -O ./results/pretrained_models/YOLOv3_Tiny-COCO-20231107.pth.tar
# change WEIGHTS_PATH in ./configs/COCO-Detection/yolov3_tiny.yaml
python ./tools/train.py ./configs/COCO-Detection/yolov3_tiny.yaml
Custom dataset
Details see CustomDataset.md.
Contributing
If you find a bug, create a GitHub issue, or even better, submit a pull request. Similarly, if you have questions,
simply post them as GitHub issues.
I look forward to seeing what the community does with these models!
Credit
YOLOv3: An Incremental Improvement
Joseph Redmon, Ali Farhadi
Abstract
We present some updates to YOLO! We made a bunch of little design changes to make it better. We also trained
this new network that’s pretty swell. It’s a little bigger than last time but more accurate. It’s still fast though,
don’t worry. At 320 × 320 YOLOv3 runs in 22 ms at 28.2 mAP, as accurate as SSD but three times faster. When we look at
the old .5 IOU mAP detection metric YOLOv3 is quite good. It achieves 57.9 AP50 in 51 ms on a Titan X, compared to 57.5
AP50 in 198 ms by RetinaNet, similar performance but 3.8× faster. As always, all the code is online
at https://pjreddie.com/yolo/.
[Paper] [Project Webpage] [Authors’ Implementation]
@article{yolov3,
title={YOLOv3: An Incremental Improvement},
author={Redmon, Joseph and Farhadi, Ali},
journal = {arXiv},
year={2018}
}
评论