# pytorch-yolov3
(cocoapi mAP计算在最下方↓↓↓)
# Introduction
This directory contains python software and an iOS App developed by Ultralytics LLC, and **is freely available for redistribution under the GPL-3.0 license**.
# Description
The https://github.com/muyiguangda/pytorch-yolov3 repo contains inference and training code for YOLOv3 in PyTorch. The code works on Linux, MacOS and Windows. Training is done on the COCO dataset by default: https://cocodataset.org/#home. **Credit to Joseph Redmon for YOLO:** https://pjreddie.com/darknet/yolo/.
# Requirements
Python 3.7 or later with the following `pip3 install -U -r requirements.txt` packages:
- `numpy`
- `torch >= 1.0.0`
- `opencv-python`
- `tqdm`
# Tutorials
* [GCP Quickstart](https://github.com/ultralytics/yolov3/wiki/GCP-Quickstart)
* [Transfer Learning](https://github.com/ultralytics/yolov3/wiki/Example:-Transfer-Learning)
* [Train Single Image](https://github.com/ultralytics/yolov3/wiki/Example:-Train-Single-Image)
* [Train Single Class](https://github.com/ultralytics/yolov3/wiki/Example:-Train-Single-Class)
* [Train Custom Data](https://github.com/ultralytics/yolov3/wiki/Train-Custom-Data)
# Training
**Start Training:** Run `train.py` to begin training after downloading COCO data with `data/get_coco_dataset.sh`.
**Resume Training:** Run `train.py --resume` resumes training from the latest checkpoint `weights/latest.pt`.
Each epoch trains on 117,263 images from the train and validate COCO sets, and tests on 5000 images from the COCO validate set. Default training settings produce loss plots below, with **training speed of 0.6 s/batch on a 1080 Ti (18 epochs/day)** or 0.45 s/batch on a 2080 Ti.
Here we see training results from `coco_1img.data`, `coco_10img.data` and `coco_100img.data`, 3 example files available in the `data/` folder, which train and test on the first 1, 10 and 100 images of the coco2014 trainval dataset.
`from utils import utils; utils.plot_results()`
![results](https://user-images.githubusercontent.com/26833433/55669383-df76c980-5876-11e9-9806-691bd507ee17.jpg)
## Image Augmentation
`datasets.py` applies random OpenCV-powered (https://opencv.org/) augmentation to the input images in accordance with the following specifications. Augmentation is applied **only** during training, not during inference. Bounding boxes are automatically tracked and updated with the images. 416 x 416 examples pictured below.
Augmentation | Description
--- | ---
Translation | +/- 10% (vertical and horizontal)
Rotation | +/- 5 degrees
Shear | +/- 2 degrees (vertical and horizontal)
Scale | +/- 10%
Reflection | 50% probability (horizontal-only)
H**S**V Saturation | +/- 50%
HS**V** Intensity | +/- 50%
## Speed
https://cloud.google.com/deep-learning-vm/
**Machine type:** n1-standard-8 (8 vCPUs, 30 GB memory)
**CPU platform:** Intel Skylake
**GPUs:** K80 ($0.198/hr), P4 ($0.279/hr), T4 ($0.353/hr), P100 ($0.493/hr), V100 ($0.803/hr)
**HDD:** 100 GB SSD
**Dataset:** COCO train 2014
GPUs | `batch_size` | batch time | epoch time | epoch cost
--- |---| --- | --- | ---
<i></i> | (images) | (s/batch) | |
1 K80 | 16 | 1.43s | 175min | $0.58
1 P4 | 8 | 0.51s | 125min | $0.58
1 T4 | 16 | 0.78s | 94min | $0.55
1 P100 | 16 | 0.39s | 48min | $0.39
2 P100 | 32 | 0.48s | 29min | $0.47
4 P100 | 64 | 0.65s | 20min | $0.65
1 V100 | 16 | 0.25s | 31min | $0.41
2 V100 | 32 | 0.29s | 18min | $0.48
4 V100 | 64 | 0.41s | 13min | $0.70
8 V100 | 128 | 0.49s | 7min | $0.80
# Inference
Run `detect.py` to apply trained weights to an image, such as `zidane.jpg` from the `data/samples` folder:
**YOLOv3:** `python3 detect.py --cfg cfg/yolov3.cfg --weights weights/yolov3.weights`
<img src="https://user-images.githubusercontent.com/26833433/50524393-b0adc200-0ad5-11e9-9335-4774a1e52374.jpg" width="600">
## Webcam
Run `detect.py` with `webcam=True` to show a live webcam feed.
# Pretrained Weights
- Darknet `*.weights` format: https://pjreddie.com/media/files/yolov3.weights
- PyTorch `*.pt` format: https://drive.google.com/drive/folders/1uxgUBemJVw9wZsdpboYbzUN4bcRhsuAI
# mAP
**1.下载代码**
sudo rm -rf pytorch-yolov3 && git clone https://github.com/muyiguangda/pytorch-yolov3
**2.获取数据集(可选)**
bash pytorch-yolov3/data/get_coco_dataset.sh
**3.配置cocoapi环境**
cd pytorch-yolov3
sudo rm -rf cocoapi && git clone https://github.com/cocodataset/cocoapi && cd cocoapi/PythonAPI && make && cd ../.. && cp -r cocoapi/PythonAPI/pycocotools .
4.**计算mAP**
* Use `python coco_predict.py --weights weights/yolov3.weights` to test the official YOLOv3 weights.
* Use `python coco_predict.py --weights weights/latest.pt` to test the latest training results.
* Use `python coco_predict.py --save-json --conf-thres 0.001 --img-size 416 --batch-size 16` to modify configuration.
* Compare to darknet published results https://arxiv.org/abs/1804.02767.
# pytorch-yolov3
没有合适的资源?快使用搜索试试~ 我知道了~
YOLOv3 PyTorch版本,添加cocoapi mAP评估 增加了中文注释 .zip
共34个文件
py:9个
txt:8个
data:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 79 浏览量
2024-11-26
11:32:34
上传
评论
收藏 55KB ZIP 举报
温馨提示
YOLOv3 PyTorch版本,添加cocoapi mAP评估。 增加了中文注释。pytorch-yolov3(cocoapi mAP计算在最下方↓↓↓)介绍该目录包含由 Ultralytics LLC 开发的 python 软件和 iOS 应用程序,可根据 GPL-3.0 许可证自由重新分发。描述https://github.com/muyiguangda/pytorch-yolov3 repo 包含 PyTorch 中YOLOv3的推理和训练代码。该代码适用于 Linux、MacOS 和 Windows。默认情况下,在 COCO 数据集上进行训练https: //cocodataset.org/#home。感谢 Joseph Redmon 为 YOLO 做出贡献 https://pjreddie.com/darknet/yolo/。要求具有以下pip3 install -U -r requirements.txt软件包的 Python 3.7 或更高版本numpytorch >= 1.0.0opencv-pythontqdm教程GCP
资源推荐
资源详情
资源评论
收起资源包目录
YOLOv3 PyTorch版本,添加cocoapi mAP评估。 增加了中文注释。.zip (34个子文件)
标签.txt 4B
weights
download_yolov3_weights.sh 757B
data
coco_1img.data 112B
coco.data 160B
coco_1img.txt 53B
coco_1cls.data 111B
coco_10img.txt 570B
coco_10img.data 114B
coco_1cls.txt 265B
coco_100img.txt 6KB
coco_1000img.data 118B
coco_1000img.txt 56KB
coco_paper.names 702B
coco.names 621B
coco_100img.data 116B
LICENSE 34KB
models.py 14KB
utils
utils.py 21KB
parse_config.py 1KB
gcp.sh 2KB
datasets.py 12KB
torch_utils.py 928B
资源内容.txt 768B
requirements.txt 194B
detect.py 5KB
.gitignore 4KB
cfg
yolov3-spp.cfg 8KB
yolov3.cfg 8KB
yolov3-1cls.cfg 8KB
yolov3-tiny.cfg 2KB
train.py 9KB
test.py 8KB
README.md 5KB
coco_predict.py 8KB
共 34 条
- 1
资源评论
徐浪老师
- 粉丝: 8228
- 资源: 9590
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- vue.calendar日期选择器
- java大型企业进销存系统源码带文字搭建教程数据库 MySQL源码类型 WebForm
- 功能丰富的 Vue 3 门户插件,用于在组件外部、应用程序的任何位置或整个文档中渲染 DOM (Vue 2 版本v2.portal-vue.linusb.org).zip
- 最新版RSA签名验签工具
- 利用vue-cli脚手架学习vue核心知识(示例小项目).zip
- 计算机网络课设模仿网易简洁、大方的设计风格.zip
- 借助 OpenLayers 的强大功能实现 Web 地图 Vue 组件.zip
- JAVA的SpringBoot职工人事管理系统源码数据库 MySQL源码类型 WebForm
- 使用vue2.x + vue-cli +vue-router+ vuex + axios + mysql + express + pm2 + webpack+nginx构建的具有登录、注册、留.zip
- 使用 Vuex 和 Vue Router 进行 JWT 身份验证的 Vue.js 演示.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功