fast-reid/GETTING_STARTED.md

37 lines
1.3 KiB
Markdown
Raw Normal View History

2020-05-12 23:00:15 +08:00
# Getting Started with Fastreid
## Prepare pretrained model
2020-05-28 20:01:20 +08:00
If you use origin ResNet, you do not need to do anything. But if you want to use ResNet-ibn or ResNeSt, you need to download pretrain model in [here](https://drive.google.com/open?id=1thS2B8UOSBi_cJX6zRy6YYRwz_nVFI_S).
And then you need to put it in `~/.cache/torch/checkpoints` or anywhere you like.
2020-05-12 23:00:15 +08:00
Then you should set the pretrain model path in `configs/Base-bagtricks.yml`.
## Compile with cython to accelerate evalution
```bash
cd fastreid/evaluation/rank_cylib; make all
```
## Training & Evaluation in Command Line
We provide a script in "tools/train_net.py", that is made to train all the configs provided in fastreid.
You may want to use it as a reference to write your own training script.
To train a model with "train_net.py", first setup up the corresponding datasets following [datasets/README.md](https://github.com/JDAI-CV/fast-reid/tree/master/datasets), then run:
```bash
2020-06-16 19:45:58 +08:00
CUDA_VISIBLE_DEVICES=$gpus ./tools/train_net.py --config-file ./configs/Market1501/bagtricks_R50.yml
```
The configs are made for 1-GPU training.
To evaluate a model's performance, use
```bash
2020-06-16 19:45:58 +08:00
CUDA_VISIBLE_DEVICES=$gpus ./tools/train_net.py --config-file ./configs/Market1501/bagtricks_R50.yml \
--eval-only MODEL.WEIGHTS /path/to/checkpoint_file
```
For more options, see `./train_net.py -h`.