Skip to content

Commit 219b0c7

Browse files
committed
update readme
1 parent 730523a commit 219b0c7

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ This library does not contain a feasible training program, please refer to the t
5858

5959
[deepsort](https://github.com/ZQPei/deep_sort_pytorch)
6060

61+
## Replacing Re-ID
62+
63+
Please read the [tutorial](docs/how_to_replace_reid.md).
64+
6165
## References
6266

6367
https://github.com/eriklindernoren/PyTorch-YOLOv3

docs/how_to_replace_reid.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# How to replace Re-ID model
2+
3+
The repository use [fast-reid](https://github.com/JDAI-CV/fast-reid) as framework to support that.
4+
So you need custom and train your model with [fast-reid](https://github.com/JDAI-CV/fast-reid) first.
5+
6+
Once you finish training your model with `fast-reid`,
7+
then you can replace your reid model as you do in fast-reid:
8+
9+
1. Check out the branch `fast-reid`
10+
11+
2. Put your custom re-id model defining in `deep_sort/deep/modeling/backbones`,
12+
such as `resnet.py`, note that you must import your factory function in
13+
`deep_sort/deep/modeling/backbones/__init__.py`,
14+
E.g: `from .resnet import build_resnet_backbone`.
15+
see more [fast-reid](https://github.com/JDAI-CV/fast-reid).
16+
17+
3. Put the config file generate by fast-reid in `config/deep`
18+
19+
4. Config the DeepSort
20+
21+
There are serveral params that have to be setting: `config_file`, `MODEL.WEIGHTS`, `MODEL.DEVICE`, the config is need for `fast-reid`.
22+
23+
```python
24+
25+
config = {"config_file": "config/deep/custom.yml",
26+
"opts": ["MODEL.WEIGHTS",
27+
"weights/model_final.pth",
28+
"MODEL.DEVICE",
29+
"cuda:0"]}
30+
cfg = setup_cfg(config)
31+
32+
tracker = DeepSort(cfg,
33+
min_confidence=1,
34+
nn_budget=30,
35+
n_init=3,
36+
max_iou_distance=0.7,
37+
max_dist=0.5,
38+
max_age=30)
39+
```
40+
41+
5. Finished
42+
43+
Now you can run the tracker with your Re-ID model.

0 commit comments

Comments
 (0)