Skip to content

Commit

Permalink
docs: add tutorials of fine-tune on a custom dataset (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
XixinYang authored Sep 26, 2023
1 parent c4b6947 commit bf0838d
Show file tree
Hide file tree
Showing 13 changed files with 1,272 additions and 171 deletions.
100 changes: 51 additions & 49 deletions benchmark_results.md

Large diffs are not rendered by default.

359 changes: 359 additions & 0 deletions docs/en/how_to_guides/finetune_with_a_custom_dataset.md

Large diffs are not rendered by default.

365 changes: 365 additions & 0 deletions docs/zh/how_to_guides/finetune_with_a_custom_dataset.md

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
This folder contains examples for various tasks, which users can run easily.

### Finetune
```
python examples/finetune.py
```
This example shows how to finetune a pretrained model on your own dataset. You can also specifiy `--freeze_backbone` to choose whether to freeze the backbone and finetune the classifier head only.


### Single process with model training and evaluation
```
python examples/train_with_func_example.py
Expand Down
108 changes: 0 additions & 108 deletions examples/finetune.py

This file was deleted.

17 changes: 17 additions & 0 deletions examples/finetune/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This folder contains scripts for fine-tuning on your own custom dataset, do refer to [tutorials](https://mindspore-lab.github.io/mindcv/how_to_guides/finetune_with_a_custom_dataset/) for details.

### split_files.py
```shell
python examples/finetune/split_files.py
```
This file taking Aircraft dataset as an example, shows how to manually reorganize data into a tree-structure directory according to an annotation file. Note that it's only for Aircraft dataset but not a general one, you'd better check the content before running it.

### read_images_online.py

This is an example demonstrating how to read the raw images as well as the labels into a `GeneratorDataset` object, which is a `MappableDataset` class that can be read directly by models. You are recommended to insert this part into your data preprocessing script or training script, but not run it alone.

### finetune.py
```shell
python examples/finetune/finetune.py --config=./configs/mobilenetv3/mobilnet_v3_small_ascend.yaml
```
A script for fine-tuning with some example code of fine-tuning methods in it (refer to the tutorial mentioned above).
Loading

0 comments on commit bf0838d

Please sign in to comment.