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

Merge recent readme update from main to v0.4.0 #814

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ MindCV is an open-source toolbox for computer vision research and development ba

The following is the corresponding `mindcv` versions and supported `mindspore` versions.

| mindcv | mindspore |
|:------:|:----------:|
| main | master |
| v0.4.0 | 2.3.0 |
| 0.3.0 | 2.2.10 |
| 0.2 | 2.0 |
| 0.1 | 1.8 |
| mindcv | mindspore |
| :----: | :---------: |
| main | master |
| v0.4.0 | 2.3.0/2.3.1 |
| 0.3.0 | 2.2.10 |
| 0.2 | 2.0 |
| 0.1 | 1.8 |


### Major Features
Expand Down Expand Up @@ -217,7 +217,6 @@ We provide the following jupyter notebook tutorials to help users learn to use M
- [Finetune a pretrained model on custom datasets](docs/en/tutorials/finetune.md)
- [Customize your model]() //coming soon
- [Optimizing performance for vision transformer]() //coming soon
- [Deployment demo](docs/en/tutorials/deployment.md)

## Model List

Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ python infer.py --model=swin_tiny --image_path='./dog.jpg'

```shell
# 分布式训练
# 假设你有4张GPU或者NPU卡
# 假设你有4张NPU卡
msrun --bind_core=True --worker_num 4 python train.py --distribute \
--model densenet121 --dataset imagenet --data_dir ./datasets/imagenet
```
Expand Down
201 changes: 102 additions & 99 deletions benchmark_results.md

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@ Please follow the outline structure and **table format** shown in [densenet/READ

<div align="center">

| Model | Context | Top-1 (%) | Top-5 (%) | Params (M) | Recipe | Download |
|--------------|----------|-----------|-----------|------------|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| densenet_121 | D910x8-G | 75.64 | 92.84 | 8.06 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/densenet/densenet_121_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/densenet/densenet121-120_5004_Ascend.ckpt) |
| model name | params(M) | cards | batch size | resolution | jit level | graph compile | ms/step | img/s | acc@top1 | acc@top5 | recipe | weight |
| ----------- | --------- | ----- | ---------- | ---------- | --------- | ------------- | ------- | ------- | -------- | -------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| densenet121 | 8.06 | 8 | 32 | 224x224 | O2 | 300s | 47,34 | 5446.81 | 75.67 | 92.77 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/densenet/densenet_121_ascend.yaml) | [weights](https://download-mindspore.osinfra.cn/toolkits/mindcv/densenet/densenet121-bf4ab27f-910v2.ckpt) |

</div>

Illustration:
- Model: model name in lower case with _ seperator.
- Context: Training context denoted as {device}x{pieces}-{MS mode}, where mindspore mode can be G - graph mode or F - pynative mode with ms function. For example, D910x8-G is for training on 8 pieces of Ascend 910 NPU using graph mode.
- Top-1 and Top-5: Accuracy reported on the validatoin set of ImageNet-1K. Keep 2 digits after the decimal point.
- Params (M): # of model parameters in millions (10^6). Keep **2 digits** after the decimal point
- Batch Size: Training batch size
- Cards: # of cards
- Ms/step: Time used on training per step in ms
- Jit_level: Jit level of mindspore context, which contains 3 levels: O0/O1/O2
- Recipe: Training recipe/configuration linked to a yaml config file.
- Download: url of the pretrained model weights

Expand All @@ -62,10 +65,10 @@ Illustration:
For consistency, it is recommended to provide distributed training commands based on `msrun --bind_core=True --worker_num {num_devices} python train.py`, instead of using shell script such as `distrubuted_train.sh`.

```shell
# standalone training on a gpu or ascend device
# standalone training on single NPU device
python train.py --config configs/densenet/densenet_121_gpu.yaml --data_dir /path/to/dataset --distribute False

# distributed training on gpu or ascend divices
# distributed training on NPU divices
msrun --bind_core=True --worker_num 8 python train.py --config configs/densenet/densenet_121_ascend.yaml --data_dir /path/to/imagenet

```
Expand Down
31 changes: 15 additions & 16 deletions configs/bit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

> [Big Transfer (BiT): General Visual Representation Learning](https://arxiv.org/abs/1912.11370)

## Requirements
| mindspore | ascend driver | firmware | cann toolkit/kernel |
| :-------: | :-----------: | :---------: | :-----------------: |
| 2.3.1 | 24.1.RC2 | 7.3.0.1.231 | 8.0.RC2.beta1 |

## Introduction

Transfer of pre-trained representations improves sample efficiency and simplifies hyperparameter tuning when training deep neural networks for vision.
Expand All @@ -13,29 +18,28 @@ BiT use GroupNorm combined with Weight Standardisation instead of BatchNorm. Sin
too low. 5) With BiT fine-tuning, good performance can be achieved even if there are only a few examples of each type on natural images.[[1, 2](#References)]


## Results
## Performance

Our reproduced model performance on ImageNet-1K is reported as follows.

performance tested on ascend 910*(8p) with graph mode
- Experiments are tested on ascend 910* with mindspore 2.3.1 graph mode

*coming soon*

performance tested on ascend 910(8p) with graph mode
- Experiments are tested on ascend 910 with mindspore 2.3.1 graph mode


<div align="center">

| Model | Top-1 (%) | Top-5 (%) | Params(M) | Batch Size | Recipe | Download |
| ------------ | --------- | --------- | --------- | ---------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| bit_resnet50 | 76.81 | 93.17 | 25.55 | 32 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/bit/bit_resnet50_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/bit/BiT_resnet50-1e4795a4.ckpt) |

| model name | params(M) | cards | batch size | resolution | jit level | graph compile | ms/step | img/s | acc@top1 | acc@top5 | recipe | weight |
| ------------ | --------- | ----- | ---------- | ---------- | --------- | ------------- | ------- | ------- | -------- | -------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| bit_resnet50 | 25.55 | 8 | 32 | 224x224 | O2 | 146s | 74.52 | 3413.33 | 76.81 | 93.17 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/bit/bit_resnet50_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/bit/BiT_resnet50-1e4795a4.ckpt) |


</div>

#### Notes

- Context: Training context denoted as {device}x{pieces}-{MS mode}, where mindspore mode can be G - graph mode or F - pynative mode with ms function. For example, D910x8-G is for training on 8 pieces of Ascend 910 NPU using graph mode.
- Top-1 and Top-5: Accuracy reported on the validation set of ImageNet-1K.

## Quick Start
Expand All @@ -44,7 +48,7 @@ performance tested on ascend 910(8p) with graph mode

#### Installation

Please refer to the [installation instruction](https://github.com/mindspore-lab/mindcv#installation) in MindCV.
Please refer to the [installation instruction](https://mindspore-lab.github.io/mindcv/installation/) in MindCV.

#### Dataset Preparation

Expand All @@ -57,11 +61,10 @@ Please download the [ImageNet-1K](https://www.image-net.org/challenges/LSVRC/201
It is easy to reproduce the reported results with the pre-defined training recipe. For distributed training on multiple Ascend 910 devices, please run

```shell
# distributed training on multiple GPU/Ascend devices
# distributed training on multiple NPU devices
msrun --bind_core=True --worker_num 8 python train.py --config configs/bit/bit_resnet50_ascend.yaml --data_dir /path/to/imagenet
```

Similarly, you can train the model on multiple GPU devices with the above `msrun` command.

For detailed illustration of all hyper-parameters, please refer to [config.py](https://github.com/mindspore-lab/mindcv/blob/main/config.py).

Expand All @@ -72,7 +75,7 @@ For detailed illustration of all hyper-parameters, please refer to [config.py](h
If you want to train or finetune the model on a smaller dataset without distributed training, please run:

```shell
# standalone training on a CPU/GPU/Ascend device
# standalone training on single NPU device
python train.py --config configs/bit/bit_resnet50_ascend.yaml --data_dir /path/to/dataset --distribute False
```

Expand All @@ -84,10 +87,6 @@ To validate the accuracy of the trained model, you can use `validate.py` and par
python validate.py -c configs/bit/bit_resnet50_ascend.yaml --data_dir /path/to/imagenet --ckpt_path /path/to/ckpt
```

### Deployment

Please refer to the [deployment tutorial](https://mindspore-lab.github.io/mindcv/tutorials/deployment/) in MindCV.

## References

<!--- Guideline: Citation format should follow GB/T 7714. -->
Expand Down
31 changes: 15 additions & 16 deletions configs/cmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

> [CMT: Convolutional Neural Networks Meet Vision Transformers](https://arxiv.org/abs/2107.06263)

## Requirements
| mindspore | ascend driver | firmware | cann toolkit/kernel |
| :-------: | :-----------: | :---------: | :-----------------: |
| 2.3.1 | 24.1.RC2 | 7.3.0.1.231 | 8.0.RC2.beta1 |

## Introduction

CMT is a method to make full use of the advantages of CNN and transformers so that the model could capture long-range
Expand All @@ -10,28 +15,27 @@ and depthwise convolution and pointwise convolution like MobileNet. By combing t
on ImageNet-1K dataset.


## Results
## Performance

Our reproduced model performance on ImageNet-1K is reported as follows.

performance tested on ascend 910*(8p) with graph mode
- Experiments are tested on ascend 910* with mindspore 2.3.1 graph mode

*coming soon*

performance tested on ascend 910(8p) with graph mode
- Experiments are tested on ascend 910 with mindspore 2.3.1 graph mode

<div align="center">

| Model | Top-1 (%) | Top-5 (%) | Params(M) | Batch Size | Recipe | Download |
| --------- | --------- | --------- | --------- | ---------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| cmt_small | 83.24 | 96.41 | 26.09 | 128 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/cmt/cmt_small_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/cmt/cmt_small-6858ee22.ckpt) |

| model name | params(M) | cards | batch size | resolution | jit level | graph compile | ms/step | img/s | acc@top1 | acc@top5 | recipe | weight |
| ---------- | --------- | ----- | ---------- | ---------- | --------- | ------------- | ------- | ------- | -------- | -------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| cmt_small | 26.09 | 8 | 128 | 224x224 | O2 | 1268s | 500.64 | 2048.01 | 83.24 | 96.41 | [yaml](https://github.com/mindspore-lab/mindcv/blob/main/configs/cmt/cmt_small_ascend.yaml) | [weights](https://download.mindspore.cn/toolkits/mindcv/cmt/cmt_small-6858ee22.ckpt) |


</div>

#### Notes

- Context: Training context denoted as {device}x{pieces}-{MS mode}, where mindspore mode can be G - graph mode or F - pynative mode with ms function. For example, D910x8-G is for training on 8 pieces of Ascend 910 NPU using graph mode.
- Top-1 and Top-5: Accuracy reported on the validation set of ImageNet-1K.

## Quick Start
Expand All @@ -40,7 +44,7 @@ performance tested on ascend 910(8p) with graph mode

#### Installation

Please refer to the [installation instruction](https://github.com/mindspore-lab/mindcv#installation) in MindCV.
Please refer to the [installation instruction](https://mindspore-lab.github.io/mindcv/installation/) in MindCV.

#### Dataset Preparation

Expand All @@ -53,11 +57,10 @@ Please download the [ImageNet-1K](https://www.image-net.org/challenges/LSVRC/201
It is easy to reproduce the reported results with the pre-defined training recipe. For distributed training on multiple Ascend 910 devices, please run

```shell
# distributed training on multiple GPU/Ascend devices
# distributed training on multiple NPU devices
msrun --bind_core=True --worker_num 8 python train.py --config configs/cmt/cmt_small_ascend.yaml --data_dir /path/to/imagenet
```

Similarly, you can train the model on multiple GPU devices with the above `msrun` command.

For detailed illustration of all hyper-parameters, please refer to [config.py](https://github.com/mindspore-lab/mindcv/blob/main/config.py).

Expand All @@ -68,7 +71,7 @@ For detailed illustration of all hyper-parameters, please refer to [config.py](h
If you want to train or finetune the model on a smaller dataset without distributed training, please run:

```shell
# standalone training on a CPU/GPU/Ascend device
# standalone training on single NPU device
python train.py --config configs/cmt/cmt_small_ascend.yaml --data_dir /path/to/dataset --distribute False
```

Expand All @@ -80,10 +83,6 @@ To validate the accuracy of the trained model, you can use `validate.py` and par
python validate.py -c configs/cmt/cmt_small_ascend.yaml --data_dir /path/to/imagenet --ckpt_path /path/to/ckpt
```

### Deployment

Please refer to the [deployment tutorial](https://mindspore-lab.github.io/mindcv/tutorials/deployment/).

## References

<!--- Guideline: Citation format should follow GB/T 7714. -->
Expand Down
Loading
Loading