Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LZHgrla committed Nov 29, 2023
1 parent 7b07364 commit 4e82739
Show file tree
Hide file tree
Showing 21 changed files with 2,996 additions and 1,309 deletions.
49 changes: 23 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DynamicDet [[arXiv]](https://arxiv.org/abs/2304.05552)
# DynamicDet [\[arXiv\]](https://arxiv.org/abs/2304.05552)

This repo contains the official implementation of [**"DynamicDet: A Unified Dynamic Architecture for Object Detection"**](https://arxiv.org/abs/2304.05552).

Expand All @@ -12,23 +12,22 @@ This repo contains the official implementation of [**"DynamicDet: A Unified Dyna

MS COCO

| Model | Easy / Hard | Size | FLOPs | FPS | AP<sup>val</sup> | AP<sup>test</sup> |
| :----------------------------------------------------------- | :---------: | :--: | :----: | :--: | :--------------: | :---------------: |
| [**Dy-YOLOv7**](https://github.com/VDIGPKU/DynamicDet/releases/download/v0.1/dy-yolov7.pt) | 90% / 10% | 640 | 112.4G | 110 | 51.4% | 52.1% |
| | 50% / 50% | 640 | 143.2G | 96 | 52.7% | 53.3% |
| | 10% / 90% | 640 | 174.0G | 85 | 53.3% | 53.8% |
| | 0% / 100% | 640 | 181.7G | 83 | 53.5% | 53.9% |
| | | | | | | |
| [**Dy-YOLOv7-X**](https://github.com/VDIGPKU/DynamicDet/releases/download/v0.1/dy-yolov7x.pt) | 90% / 10% | 640 | 201.7G | 98 | 53.0% | 53.3% |
| | 50% / 50% | 640 | 248.9G | 78 | 54.2% | 54.4% |
| | 10% / 90% | 640 | 296.1G | 65 | 54.7% | 55.0% |
| | 0% / 100% | 640 | 307.9G | 64 | 54.8% | 55.0% |
| | | | | | | |
| [**Dy-YOLOv7-W6**](https://github.com/VDIGPKU/DynamicDet/releases/download/v0.1/dy-yolov7-w6.pt) | 90% / 10% | 1280 | 384.2G | 74 | 54.9% | 55.2% |
| | 50% / 50% | 1280 | 480.8G | 58 | 55.9% | 56.1% |
| | 10% / 90% | 1280 | 577.4G | 48 | 56.4% | 56.7% |
| | 0% / 100% | 1280 | 601.6G | 46 | 56.5% | 56.8% |

| Model | Easy / Hard | Size | FLOPs | FPS | AP<sup>val</sup> | AP<sup>test</sup> |
| :----------------------------------------------------------------------------------------------- | :---------: | :--: | :----: | :-: | :--------------: | :---------------: |
| [**Dy-YOLOv7**](https://github.com/VDIGPKU/DynamicDet/releases/download/v0.1/dy-yolov7.pt) | 90% / 10% | 640 | 112.4G | 110 | 51.4% | 52.1% |
| | 50% / 50% | 640 | 143.2G | 96 | 52.7% | 53.3% |
| | 10% / 90% | 640 | 174.0G | 85 | 53.3% | 53.8% |
| | 0% / 100% | 640 | 181.7G | 83 | 53.5% | 53.9% |
| | | | | | | |
| [**Dy-YOLOv7-X**](https://github.com/VDIGPKU/DynamicDet/releases/download/v0.1/dy-yolov7x.pt) | 90% / 10% | 640 | 201.7G | 98 | 53.0% | 53.3% |
| | 50% / 50% | 640 | 248.9G | 78 | 54.2% | 54.4% |
| | 10% / 90% | 640 | 296.1G | 65 | 54.7% | 55.0% |
| | 0% / 100% | 640 | 307.9G | 64 | 54.8% | 55.0% |
| | | | | | | |
| [**Dy-YOLOv7-W6**](https://github.com/VDIGPKU/DynamicDet/releases/download/v0.1/dy-yolov7-w6.pt) | 90% / 10% | 1280 | 384.2G | 74 | 54.9% | 55.2% |
| | 50% / 50% | 1280 | 480.8G | 58 | 55.9% | 56.1% |
| | 10% / 90% | 1280 | 577.4G | 48 | 56.4% | 56.7% |
| | 0% / 100% | 1280 | 601.6G | 46 | 56.5% | 56.8% |

<details>
<summary> Table Notes </summary>
Expand All @@ -39,7 +38,6 @@ MS COCO

</details>


## Quick Start

### Installation
Expand All @@ -50,7 +48,6 @@ conda install pytorch=1.11 cudatoolkit=11.3 torchvision -c pytorch
pip install -r requirements.txt
```


### Data preparation

Download MS COCO dataset images ([train](http://images.cocodataset.org/zips/train2017.zip), [val](http://images.cocodataset.org/zips/val2017.zip), [test](http://images.cocodataset.org/zips/test2017.zip)) and [labels](https://github.com/VDIGPKU/DynamicDet/releases/download/v0.1/coco2017labels-segments.zip).
Expand Down Expand Up @@ -95,21 +92,21 @@ python train_step2.py --workers 4 --device 0 --batch-size 1 --epochs 2 --img 640

### Getting the dynamic thresholds for variable-speed inference

```bash
```bash
python get_dynamic_thres.py --device 0 --batch-size 1 --img-size 640 --cfg cfg/dy-yolov7-step2.yaml --weight weights/dy-yolov7.pt --data data/coco.yaml --task val
```
```

### Testing

```bash
```bash
python test.py --img-size 640 --batch-size 1 --conf 0.001 --iou 0.65 --device 0 --cfg cfg/dy-yolov7-step2.yaml --weight weights/dy-yolov7.pt --data data/coco.yaml --dy-thres <DY_THRESHOLD>
```
```

### Inference

```bash
```bash
python detect.py --cfg cfg/dy-yolov7-step2.yaml --weight weights/dy-yolov7.pt --num-classes 80 --source <IMAGE/VIDEO> --device 0 --dy-thres <DY_THRESHOLD>
```
```

## Citation

Expand Down
Loading

0 comments on commit 4e82739

Please sign in to comment.