Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New YOLOv5 Classification Models #8956

Merged
merged 448 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
448 commits
Select commit Hold shift + click to select a range
4602c01
Update
glenn-jocher Jul 20, 2022
798cab5
Logger step fix: Increment step with epochs (#8654)
AyushExel Jul 20, 2022
5d69e04
Update
glenn-jocher Jul 20, 2022
fceeb9a
Update
glenn-jocher Jul 20, 2022
bdb33b9
Update
glenn-jocher Jul 21, 2022
5fdeba7
Update
glenn-jocher Jul 21, 2022
bc72ec0
Update
glenn-jocher Jul 21, 2022
1b00861
Update
glenn-jocher Jul 21, 2022
053ada1
Update
glenn-jocher Jul 21, 2022
167406d
Update
glenn-jocher Jul 21, 2022
dbe92bb
Update
glenn-jocher Jul 21, 2022
761c1d3
Update
glenn-jocher Jul 21, 2022
07297c4
Update
glenn-jocher Jul 21, 2022
d80c2f5
Update
glenn-jocher Jul 21, 2022
8610aa8
Update
glenn-jocher Jul 21, 2022
0524acb
Update
glenn-jocher Jul 21, 2022
c31cfb4
Update
glenn-jocher Jul 21, 2022
0610a5d
Update
glenn-jocher Jul 21, 2022
1433d3b
Update
glenn-jocher Jul 21, 2022
b66d142
Update
glenn-jocher Jul 21, 2022
3a7a404
Update
glenn-jocher Jul 21, 2022
d11fc06
Update
glenn-jocher Jul 21, 2022
334f8bc
Update
glenn-jocher Jul 21, 2022
ebebb62
Update
glenn-jocher Jul 21, 2022
8faadee
Update
glenn-jocher Jul 21, 2022
0a5a0ab
Update
glenn-jocher Jul 22, 2022
7cc91cc
Update
glenn-jocher Jul 22, 2022
a545207
Update
glenn-jocher Jul 22, 2022
50aaf98
Update
glenn-jocher Jul 22, 2022
1c2f432
Allow logging models from GenericLogger (#8676)
AyushExel Jul 22, 2022
5760567
Update
glenn-jocher Jul 22, 2022
c2095e1
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Jul 22, 2022
a551986
Update
glenn-jocher Jul 22, 2022
6c9ff8c
Update
glenn-jocher Jul 22, 2022
956879b
Update
glenn-jocher Jul 22, 2022
bfb5c1f
Update
glenn-jocher Jul 22, 2022
5ed36ee
Update warning emojis
glenn-jocher Jul 22, 2022
04d3e64
Update dataset download
glenn-jocher Jul 22, 2022
dcf5670
Update dataset download
glenn-jocher Jul 22, 2022
a86fdd0
Update
glenn-jocher Jul 22, 2022
2a59208
Update
glenn-jocher Jul 22, 2022
b80dd7e
Update
glenn-jocher Jul 22, 2022
1097af8
Update
glenn-jocher Jul 22, 2022
4edd9b2
Update
glenn-jocher Jul 22, 2022
9256d45
Update
glenn-jocher Jul 22, 2022
1d72089
Update
glenn-jocher Jul 22, 2022
73bb5ff
Update
glenn-jocher Jul 22, 2022
0670b38
Update
glenn-jocher Jul 22, 2022
aa9184d
Update
glenn-jocher Jul 22, 2022
3626508
Update
glenn-jocher Jul 22, 2022
aa32e13
Update
glenn-jocher Jul 22, 2022
0e010ae
Update
glenn-jocher Jul 22, 2022
1ecaf0b
Update
glenn-jocher Jul 22, 2022
685503b
Update
glenn-jocher Jul 22, 2022
101b21f
Update
glenn-jocher Jul 22, 2022
97d1fa6
Update
glenn-jocher Jul 22, 2022
19ffb4e
Update
glenn-jocher Jul 22, 2022
95eca5d
Update
glenn-jocher Jul 22, 2022
fa44db7
Update
glenn-jocher Jul 23, 2022
b751ab2
Update
glenn-jocher Jul 23, 2022
ff85584
Update
glenn-jocher Jul 23, 2022
e1fb3e6
Pass imgsz to classify_transforms()
glenn-jocher Jul 23, 2022
7a73663
Update
glenn-jocher Jul 23, 2022
e535213
Update
glenn-jocher Jul 23, 2022
f839244
Update
glenn-jocher Jul 23, 2022
2c90896
Update
glenn-jocher Jul 23, 2022
a6d5521
Update
glenn-jocher Jul 23, 2022
9dc5e6a
Update
glenn-jocher Jul 24, 2022
1782d0c
Update
glenn-jocher Jul 24, 2022
84d6bd7
Update
glenn-jocher Jul 25, 2022
a06efbd
Update
glenn-jocher Jul 25, 2022
6432df0
Update
glenn-jocher Jul 25, 2022
d86bb55
Update
glenn-jocher Jul 25, 2022
0d6490c
Update
glenn-jocher Jul 25, 2022
12421e1
Update
glenn-jocher Jul 25, 2022
5f3773b
Update
glenn-jocher Jul 25, 2022
9db31ea
Update
glenn-jocher Jul 25, 2022
0551a31
Update
glenn-jocher Jul 25, 2022
f12bc8a
Update
glenn-jocher Jul 26, 2022
9d9e16f
Update
glenn-jocher Jul 26, 2022
55f0fa8
Update
glenn-jocher Jul 26, 2022
fabac7c
Update
glenn-jocher Jul 26, 2022
e64ba0e
Update
glenn-jocher Jul 27, 2022
1038734
Update
glenn-jocher Jul 27, 2022
86dd4d9
Cos scheduler
glenn-jocher Jul 30, 2022
2594685
Cos scheduler
glenn-jocher Jul 30, 2022
0251d35
Remove unused args
glenn-jocher Jul 30, 2022
1f7b95c
Update
glenn-jocher Jul 30, 2022
e88ba9d
Add seed
glenn-jocher Jul 30, 2022
f610079
Add seed
glenn-jocher Jul 30, 2022
635ab3f
Update
glenn-jocher Jul 30, 2022
eea5731
Update
glenn-jocher Jul 30, 2022
ef749a1
Add run(), main()
glenn-jocher Jul 30, 2022
d2cde35
Merge master
glenn-jocher Jul 30, 2022
8a0da6d
Merge master
glenn-jocher Jul 30, 2022
a92840a
Merge master
glenn-jocher Jul 30, 2022
976d5c7
Merge master
glenn-jocher Jul 31, 2022
f43572e
Update
glenn-jocher Aug 1, 2022
cabbb30
Update
glenn-jocher Aug 1, 2022
59b2353
Update
glenn-jocher Aug 1, 2022
c5b92f5
Update
glenn-jocher Aug 1, 2022
ebb9c99
Update
glenn-jocher Aug 1, 2022
7c1225f
Update
glenn-jocher Aug 1, 2022
e24b47d
Update
glenn-jocher Aug 1, 2022
8ac8830
Merge master
glenn-jocher Aug 1, 2022
ebb141a
fix
glenn-jocher Aug 1, 2022
e567764
Create YOLOv5 BaseModel class (#8829)
glenn-jocher Aug 2, 2022
13c46bd
Add experiment
glenn-jocher Aug 3, 2022
1e548f0
Merge master
glenn-jocher Aug 3, 2022
3284fe7
Merge master
glenn-jocher Aug 3, 2022
1e9994a
Merge master
glenn-jocher Aug 4, 2022
903169a
Attach names
glenn-jocher Aug 4, 2022
84cc9bf
Merge master
glenn-jocher Aug 4, 2022
2291181
weight decay = 1e-4
glenn-jocher Aug 4, 2022
524e989
weight decay = 5e-5
glenn-jocher Aug 4, 2022
4d3fede
update smart_optimizer console printout
glenn-jocher Aug 4, 2022
2fe1b97
fashion-mnist fix
glenn-jocher Aug 4, 2022
6a01f58
Merge master
glenn-jocher Aug 9, 2022
7114bb9
Merge master
glenn-jocher Aug 9, 2022
ef00f41
Merge master
glenn-jocher Aug 9, 2022
01bc47f
Merge master
glenn-jocher Aug 13, 2022
9c5a035
Update Table
glenn-jocher Aug 13, 2022
bd135ba
Update Table
glenn-jocher Aug 13, 2022
012476b
Remove destroy process group
glenn-jocher Aug 13, 2022
037fb37
Merge master
glenn-jocher Aug 13, 2022
a1e81df
add kwargs to forward()
glenn-jocher Aug 13, 2022
9c17a70
fuse fix for resnet50
glenn-jocher Aug 13, 2022
7132881
nc, names fix for resnet50
glenn-jocher Aug 13, 2022
a512ab0
nc, names fix for resnet50
glenn-jocher Aug 13, 2022
c2cab3a
ONNX CPU inference fix
glenn-jocher Aug 13, 2022
6302731
revert
glenn-jocher Aug 13, 2022
7a60338
cuda
glenn-jocher Aug 13, 2022
ea8d237
if augment or visualize
glenn-jocher Aug 13, 2022
49720f7
if augment or visualize
glenn-jocher Aug 13, 2022
3f5c692
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 13, 2022
f27df13
New smart_inference_mode()
glenn-jocher Aug 13, 2022
0a07a83
New smart_inference_mode()
glenn-jocher Aug 13, 2022
5fe56fc
Update README
glenn-jocher Aug 13, 2022
7c93f2c
Refactor into /classify dir
glenn-jocher Aug 14, 2022
ea8729b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2022
0173fdf
comma fix
glenn-jocher Aug 14, 2022
30e46ed
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2022
1d961a4
reset defaults
glenn-jocher Aug 14, 2022
9f666e3
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 14, 2022
52b73c7
reset defaults
glenn-jocher Aug 14, 2022
d97848e
fix gpu predict
glenn-jocher Aug 14, 2022
17564e1
warmup
glenn-jocher Aug 14, 2022
f1f71c9
ema half fix
glenn-jocher Aug 14, 2022
26d3a1e
spacing
glenn-jocher Aug 14, 2022
0e9ba3c
remove data
glenn-jocher Aug 14, 2022
4a982ae
remove cache
glenn-jocher Aug 14, 2022
dada286
remove denormalize
glenn-jocher Aug 14, 2022
03e7a97
save run settings
glenn-jocher Aug 14, 2022
ef20d65
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2022
bc969a7
verbose false on initial plots
glenn-jocher Aug 14, 2022
4d03b79
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 14, 2022
fbff212
new save_yaml() function
glenn-jocher Aug 14, 2022
59e1300
Update ci-testing.yml
glenn-jocher Aug 14, 2022
61f635f
Path(data) CI fix
glenn-jocher Aug 14, 2022
e8ed7cd
Separate classification CI
glenn-jocher Aug 14, 2022
379a936
fix val
glenn-jocher Aug 14, 2022
f81686d
fix val
glenn-jocher Aug 14, 2022
3dd6ef3
fix val
glenn-jocher Aug 14, 2022
e378210
smartCrossEntropyLoss
glenn-jocher Aug 14, 2022
56c5b8e
skip validation on hub load
glenn-jocher Aug 14, 2022
0e5720b
autodownload with working dir root
glenn-jocher Aug 14, 2022
22b9d4b
str(data)
glenn-jocher Aug 14, 2022
986390d
Dataset usage example
glenn-jocher Aug 14, 2022
b456f51
im_show normalize
glenn-jocher Aug 14, 2022
b7f3016
im_show normalize
glenn-jocher Aug 14, 2022
e663ff4
add imagenet simple names to multibackend
glenn-jocher Aug 14, 2022
cb13e7f
Add validation speeds
glenn-jocher Aug 14, 2022
92fd072
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2022
d864cda
24-space names
glenn-jocher Aug 14, 2022
eafe847
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 14, 2022
4020446
Update bash scripts
glenn-jocher Aug 14, 2022
044022b
Update permissions
glenn-jocher Aug 14, 2022
3d2d112
Add bash script arguments
glenn-jocher Aug 14, 2022
b41070b
Merge branch 'master' into classifier
glenn-jocher Aug 14, 2022
13ec336
remove verbose
glenn-jocher Aug 14, 2022
95090dc
TRT data fix
glenn-jocher Aug 15, 2022
e749931
names generator fix
glenn-jocher Aug 15, 2022
3e6b07a
optimize if names
glenn-jocher Aug 15, 2022
5963a25
update usage
glenn-jocher Aug 15, 2022
d35d9f0
Add local loading
glenn-jocher Aug 15, 2022
cb8ddc0
Verbose=False
glenn-jocher Aug 15, 2022
5a5bd4e
update names printing
glenn-jocher Aug 15, 2022
b3bd5a1
Add Usage examples
glenn-jocher Aug 15, 2022
4086b0f
Add Usage examples
glenn-jocher Aug 15, 2022
6d2ce08
Add Usage examples
glenn-jocher Aug 15, 2022
d212511
Add Usage examples
glenn-jocher Aug 15, 2022
3951615
Merge master
glenn-jocher Aug 15, 2022
1abaf42
named_children
glenn-jocher Aug 15, 2022
db2f7b3
reshape_classifier_outputs
glenn-jocher Aug 15, 2022
5b2070b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 15, 2022
1338c6d
update
glenn-jocher Aug 15, 2022
ab97b5a
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 15, 2022
b088d52
update
glenn-jocher Aug 15, 2022
6730731
fix CI
glenn-jocher Aug 15, 2022
fc3b0bb
fix incorrect class substitution
glenn-jocher Aug 15, 2022
0ff0ec2
fix incorrect class substitution
glenn-jocher Aug 15, 2022
72e5607
remove denormalize
glenn-jocher Aug 15, 2022
bf1dae5
ravel fix
glenn-jocher Aug 15, 2022
5f64ebd
cleanup
glenn-jocher Aug 15, 2022
bdee2e4
update opt file printing
glenn-jocher Aug 15, 2022
fd388d6
update opt file printing
glenn-jocher Aug 15, 2022
1a307b8
update defaults
glenn-jocher Aug 15, 2022
4ab5ee6
Merge branch 'master' into classifier
glenn-jocher Aug 15, 2022
6a347f3
add opt to checkpoint
glenn-jocher Aug 15, 2022
48da61b
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 15, 2022
26dfbe3
Add warning
glenn-jocher Aug 16, 2022
8ee42ff
Merge branch 'master' into classifier
glenn-jocher Aug 16, 2022
b6d3018
Add comment
glenn-jocher Aug 16, 2022
0c97910
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 16, 2022
cc60aef
Merge branch 'master' into classifier
glenn-jocher Aug 16, 2022
04e84d6
plot half bug fix
glenn-jocher Aug 16, 2022
9d9a2f1
Use NotImplementedError
glenn-jocher Aug 16, 2022
44584ce
fix export shape report
glenn-jocher Aug 16, 2022
b26129b
Fix TRT load
glenn-jocher Aug 16, 2022
7449066
cleanup CI
glenn-jocher Aug 16, 2022
c0f0b7b
profile comment
glenn-jocher Aug 16, 2022
01806e3
CI fix
glenn-jocher Aug 16, 2022
1d867fd
Add cls models
glenn-jocher Aug 16, 2022
4b75256
Merge branch 'master' into classifier
glenn-jocher Aug 16, 2022
ebb99af
avoid inplace error
glenn-jocher Aug 16, 2022
3652de4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 16, 2022
105c73a
Merge branch 'master' into classifier
glenn-jocher Aug 16, 2022
d1c84ae
Fix usage examples
glenn-jocher Aug 16, 2022
c99c051
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 16, 2022
706ff96
Update README
glenn-jocher Aug 16, 2022
6f4a1bb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 16, 2022
b5f8748
Update README
glenn-jocher Aug 16, 2022
ca01d76
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 16, 2022
0a8f489
Update README
glenn-jocher Aug 16, 2022
33ae017
Update README
glenn-jocher Aug 16, 2022
7c494aa
Update README
glenn-jocher Aug 16, 2022
dcdc38b
Update README
glenn-jocher Aug 16, 2022
85289d4
Update README
glenn-jocher Aug 16, 2022
ef63af1
Update README
glenn-jocher Aug 17, 2022
105184c
Update README
glenn-jocher Aug 17, 2022
47bbaee
Update README
glenn-jocher Aug 17, 2022
4719685
Update README
glenn-jocher Aug 17, 2022
55d85a6
Update README
glenn-jocher Aug 17, 2022
e8ce124
Update README
glenn-jocher Aug 17, 2022
78e1bf9
Update README
glenn-jocher Aug 17, 2022
d0a3e70
Update README
glenn-jocher Aug 17, 2022
4b398df
Update README
glenn-jocher Aug 17, 2022
e90cc95
Merge branch 'master' into classifier
glenn-jocher Aug 17, 2022
9a43979
Update README
glenn-jocher Aug 17, 2022
4b231d4
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Aug 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 92 additions & 17 deletions .github/README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,26 +171,23 @@ python train.py --data coco.yaml --cfg yolov5n.yaml --weights '' --batch-size 12
## <div align="center">如何与第三方集成</div>

<div align="center">
<a href="https://wandb.ai/site?utm_campaign=repo_yolo_readme">
<img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-wb-long.png" width="49%"/>
</a>
<a href="https://roboflow.com/?ref=ultralytics">
<img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-roboflow-long.png" width="49%"/>
</a>
<a href="https://bit.ly/yolov5-deci-platform">
<img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-deci.png" width="10%" /></a>
<img src="https://github.com/ultralytics/assets/raw/master/social/logo-transparent.png" width="14%" height="0" alt="" />
<a href="https://cutt.ly/yolov5-readme-clearml">
<img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-clearml.png" width="10%" /></a>
<img src="https://github.com/ultralytics/assets/raw/master/social/logo-transparent.png" width="14%" height="0" alt="" />
<a href="https://roboflow.com/?ref=ultralytics">
<img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-roboflow.png" width="10%" /></a>
<img src="https://github.com/ultralytics/assets/raw/master/social/logo-transparent.png" width="14%" height="0" alt="" />
<a href="https://wandb.ai/site?utm_campaign=repo_yolo_readme">
<img src="https://github.com/ultralytics/yolov5/releases/download/v1.0/logo-wb.png" width="10%" /></a>
</div>

|Weights and Biases|Roboflow ⭐ 新|
|:-:|:-:|
|通过 [Weights & Biases](https://wandb.ai/site?utm_campaign=repo_yolo_readme) 自动跟踪和可视化你在云端的所有YOLOv5训练运行状态。|标记并将您的自定义数据集直接导出到YOLOv5,以便用 [Roboflow](https://roboflow.com/?ref=ultralytics) 进行训练。 |

<!-- ## <div align="center">Compete and Win</div>
|Deci ⭐ NEW|ClearML ⭐ NEW|Roboflow|Weights & Biases
|:-:|:-:|:-:|:-:|
|Automatically compile and quantize YOLOv5 for better inference performance in one click at [Deci](https://bit.ly/yolov5-deci-platform)|Automatically track, visualize and even remotely train YOLOv5 using [ClearML](https://cutt.ly/yolov5-readme-clearml) (open-source!)|Label and export your custom datasets directly to YOLOv5 for training with [Roboflow](https://roboflow.com/?ref=ultralytics) |Automatically track and visualize all your YOLOv5 training runs in the cloud with [Weights & Biases](https://wandb.ai/site?utm_campaign=repo_yolo_readme)

We are super excited about our first-ever Ultralytics YOLOv5 🚀 EXPORT Competition with **$10,000** in cash prizes!

<p align="center">
<a href="https://github.com/ultralytics/yolov5/discussions/3213">
<img width="850" src="https://github.com/ultralytics/yolov5/releases/download/v1.0/banner-export-competition.png"></a>
</p> -->

## <div align="center">为什么选择 YOLOv5</div>

Expand Down Expand Up @@ -239,6 +236,84 @@ We are super excited about our first-ever Ultralytics YOLOv5 🚀 EXPORT Competi

</details>


## <div align="center">Classification ⭐ NEW</div>

YOLOv5 [release v6.2](https://github.com/ultralytics/yolov5/releases) brings support for classification model training, validation, prediction and export! We've made training classifier models super simple. Click below to get started.

<details>
<summary>Classification Checkpoints (click to expand)</summary>

<br>

We trained YOLOv5-cls classification models on ImageNet for 90 epochs using a 4xA100 instance, and we trained ResNet and EfficientNet models alongside with the same default training settings to compare. We exported all models to ONNX FP32 for CPU speed tests and to TensorRT FP16 for GPU speed tests. We ran all speed tests on Google [Colab Pro](https://colab.research.google.com/signup) for easy reproducibility.

| Model | size<br><sup>(pixels) | acc<br><sup>top1 | acc<br><sup>top5 | Training<br><sup>90 epochs<br>4xA100 (hours) | Speed<br><sup>ONNX CPU<br>(ms) | Speed<br><sup>TensorRT V100<br>(ms) | params<br><sup>(M) | FLOPs<br><sup>@224 (B) |
|----------------------------------------------------------------------------------------------------|-----------------------|------------------|------------------|----------------------------------------------|--------------------------------|-------------------------------------|--------------------|------------------------|
| [YOLOv5n-cls](https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5n-cls.pt) | 224 | 64.6 | 85.4 | 7:59 | **3.3** | **0.5** | **2.5** | **0.5** |
| [YOLOv5s-cls](https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5s-cls.pt) | 224 | 71.5 | 90.2 | 8:09 | 6.6 | 0.6 | 5.4 | 1.4 |
| [YOLOv5m-cls](https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5m-cls.pt) | 224 | 75.9 | 92.9 | 10:06 | 15.5 | 0.9 | 12.9 | 3.9 |
| [YOLOv5l-cls](https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5l-cls.pt) | 224 | 78.0 | 94.0 | 11:56 | 26.9 | 1.4 | 26.5 | 8.5 |
| [YOLOv5x-cls](https://github.com/ultralytics/yolov5/releases/download/v6.2/yolov5x-cls.pt) | 224 | **79.0** | **94.4** | 15:04 | 54.3 | 1.8 | 48.1 | 15.9 |
| |
| [ResNet18](https://github.com/ultralytics/yolov5/releases/download/v6.2/resnet18.pt) | 224 | 70.3 | 89.5 | **6:47** | 11.2 | 0.5 | 11.7 | 3.7 |
| [ResNet34](https://github.com/ultralytics/yolov5/releases/download/v6.2/resnet34.pt) | 224 | 73.9 | 91.8 | 8:33 | 20.6 | 0.9 | 21.8 | 7.4 |
| [ResNet50](https://github.com/ultralytics/yolov5/releases/download/v6.2/resnet50.pt) | 224 | 76.8 | 93.4 | 11:10 | 23.4 | 1.0 | 25.6 | 8.5 |
| [ResNet101](https://github.com/ultralytics/yolov5/releases/download/v6.2/resnet101.pt) | 224 | 78.5 | 94.3 | 17:10 | 42.1 | 1.9 | 44.5 | 15.9 |
| |
| [EfficientNet_b0](https://github.com/ultralytics/yolov5/releases/download/v6.2/efficientnet_b0.pt) | 224 | 75.1 | 92.4 | 13:03 | 12.5 | 1.3 | 5.3 | 1.0 |
| [EfficientNet_b1](https://github.com/ultralytics/yolov5/releases/download/v6.2/efficientnet_b1.pt) | 224 | 76.4 | 93.2 | 17:04 | 14.9 | 1.6 | 7.8 | 1.5 |
| [EfficientNet_b2](https://github.com/ultralytics/yolov5/releases/download/v6.2/efficientnet_b2.pt) | 224 | 76.6 | 93.4 | 17:10 | 15.9 | 1.6 | 9.1 | 1.7 |
| [EfficientNet_b3](https://github.com/ultralytics/yolov5/releases/download/v6.2/efficientnet_b3.pt) | 224 | 77.7 | 94.0 | 19:19 | 18.9 | 1.9 | 12.2 | 2.4 |

<details>
<summary>Table Notes (click to expand)</summary>

- All checkpoints are trained to 90 epochs with SGD optimizer with lr0=0.001 at image size 224 and all default settings. Runs logged to https://wandb.ai/glenn-jocher/YOLOv5-Classifier-v6-2.
- **Accuracy** values are for single-model single-scale on [ImageNet-1k](https://www.image-net.org/index.php) dataset.<br>Reproduce by `python classify/val.py --data ../datasets/imagenet --img 224`
- **Speed** averaged over 100 inference images using a Google [Colab Pro](https://colab.research.google.com/signup) V100 High-RAM instance.<br>Reproduce by `python classify/val.py --data ../datasets/imagenet --img 224 --batch 1`
- **Export** to ONNX at FP32 and TensorRT at FP16 done with `export.py`. <br>Reproduce by `python export.py --weights yolov5s-cls.pt --include engine onnx --imgsz 224`
</details>
</details>

<details>
<summary>Classification Usage Examples (click to expand)</summary>

### Train
YOLOv5 classification training supports auto-download of MNIST, Fashion-MNIST, CIFAR10, CIFAR100, Imagenette, Imagewoof, and ImageNet datasets with the `--data` argument. To start training on MNIST for example use `--data mnist`.

```bash
# Single-GPU
python classify/train.py --model yolov5s-cls.pt --data cifar100 --epochs 5 --img 224 --batch 128

# Multi-GPU DDP
python -m torch.distributed.run --nproc_per_node 4 --master_port 1 classify/train.py --model yolov5s-cls.pt --data imagenet --epochs 5 --img 224 --device 0,1,2,3
```

### Val
Validate accuracy on a pretrained model. To validate YOLOv5s-cls accuracy on ImageNet.
```bash
bash data/scripts/get_imagenet.sh --val # download ImageNet val split (6.3G, 50000 images)
python classify/val.py --weights yolov5s-cls.pt --data ../datasets/imagenet --img 224
```

### Predict
Run a classification prediction on an image.
```bash
python classify/predict.py --weights yolov5s-cls.pt --data data/images/bus.jpg
```
```python
model = torch.hub.load('ultralytics/yolov5', 'custom', 'yolov5s-cls.pt') # load from PyTorch Hub
```

### Export
Export a group of trained YOLOv5-cls, ResNet and EfficientNet models to ONNX and TensorRT.
```bash
python export.py --weights yolov5s-cls.pt resnet50.pt efficientnet_b0.pt --include onnx engine --img 224
```
</details>


## <div align="center">贡献</div>

我们重视您的意见! 我们希望给大家提供尽可能的简单和透明的方式对 YOLOv5 做出贡献。开始之前请先点击并查看我们的 [贡献指南](CONTRIBUTING.md),填写[YOLOv5调查问卷](https://ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey) 来向我们发送您的经验反馈。真诚感谢我们所有的贡献者!
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: YOLOv5 CI

on:
push:
branches: [master]
branches: [ master ]
pull_request:
branches: [master]
branches: [ master ]
schedule:
- cron: '0 0 * * *' # runs at 00:00 UTC every day

Expand All @@ -16,9 +16,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.9'] # requires python<=3.9
model: [yolov5n]
os: [ ubuntu-latest ]
python-version: [ '3.9' ] # requires python<=3.9
model: [ yolov5n ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down Expand Up @@ -47,9 +47,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10']
model: [yolov5n]
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ '3.10' ]
model: [ yolov5n ]
include:
- os: ubuntu-latest
python-version: '3.7' # '3.6.8' min
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
else
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
fi
shell: bash # required for Windows compatibility
shell: bash # for Windows compatibility
- name: Check environment
run: |
python -c "import utils; utils.notebook_init()"
Expand All @@ -100,8 +100,8 @@ jobs:
python --version
pip --version
pip list
- name: Run tests
shell: bash
- name: Test detection
shell: bash # for Windows compatibility
run: |
# export PYTHONPATH="$PWD" # to run '$ python *.py' files in subdirectories
m=${{ matrix.model }} # official weights
Expand All @@ -123,3 +123,13 @@ jobs:
model = torch.hub.load('.', 'custom', path=path, source='local')
print(model('data/images/bus.jpg'))
EOF
- name: Test classification
shell: bash # for Windows compatibility
run: |
m=${{ matrix.model }}-cls.pt # official weights
b=runs/train-cls/exp/weights/best.pt # best.pt checkpoint
python classify/train.py --imgsz 32 --model $m --data mnist2560 --epochs 1 # train
python classify/val.py --imgsz 32 --weights $b --data ../datasets/mnist2560 # val
python classify/predict.py --imgsz 32 --weights $b --source ../datasets/mnist2560/test/7/60.png # predict
python classify/predict.py --imgsz 32 --weights $m --source data/images/bus.jpg # predict
python export.py --weights $b --img 64 --imgsz 224 --include torchscript # export
Loading