Skip to content

Commit

Permalink
main code
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
WongKinYiu authored Jul 14, 2022
1 parent 31e2a90 commit 3070e13
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Implementation of paper - [YOLOv7: Trainable bag-of-freebies sets new state-of-t

<div align="center">
<a href="./">
<img src="./figure/performance.png" width="59%"/>
<img src="./figure/performance.png" width="79%"/>
</a>
</div>

Expand Down Expand Up @@ -105,6 +105,20 @@ python -m torch.distributed.launch --nproc_per_node 4 --master_port 9527 train.p
python -m torch.distributed.launch --nproc_per_node 8 --master_port 9527 train_aux.py --workers 8 --device 0,1,2,3,4,5,6,7 --sync-bn --batch-size 128 --data data/coco.yaml --img 1280 1280 --cfg cfg/training/yolov7-w6.yaml --weights '' --name yolov7-w6 --hyp data/hyp.scratch.p6.yaml
```

## Transfer learning

[`yolov7_training.pt`](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7_training.pt) [`yolov7x_training.pt`](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7x_training.pt) [`yolov7-w6_training.pt`](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6_training.pt) [`yolov7-e6_training.pt`](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6_training.pt) [`yolov7-d6_training.pt`](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-d6_training.pt) [`yolov7-e6e_training.pt`](https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-e6e_training.pt)

Single GPU finetuning for custom dataset

``` bash
# finetune p5 models
python train.py --workers 8 --device 0 --batch-size 32 --data data/custom.yaml --img 640 640 --cfg cfg/training/yolov7-custom.yaml --weights 'yolov7_training.pt' --name yolov7-custom --hyp data/hyp.scratch.custom.yaml

# finetune p6 models
python train_aux.py --workers 8 --device 0 --batch-size 16 --data data/custom.yaml --img 1280 1280 --cfg cfg/training/yolov7-w6-custom.yaml --weights 'yolov7-w6_training.pt' --name yolov7-w6-custom --hyp data/hyp.scratch.custom.yaml
```

## Re-parameterization

See [reparameterization.ipynb](tools/reparameterization.ipynb)
Expand All @@ -117,7 +131,7 @@ python detect.py --weights yolov7.pt --conf 0.25 --img-size 640 --source inferen

<div align="center">
<a href="./">
<img src="./figure/horses_prediction.jpg" width="49%"/>
<img src="./figure/horses_prediction.jpg" width="59%"/>
</a>
</div>

Expand Down

0 comments on commit 3070e13

Please sign in to comment.