Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,121 @@
|
|
1 |
---
|
2 |
license: gpl-3.0
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: gpl-3.0
|
3 |
+
tags:
|
4 |
+
- object-detection
|
5 |
+
- computer-vision
|
6 |
+
- sort
|
7 |
+
- tracker
|
8 |
+
- osnet
|
9 |
---
|
10 |
+
|
11 |
+
<div align="center">
|
12 |
+
<h1>
|
13 |
+
Torchreid-Pip: Packaged version of Torchreid
|
14 |
+
</h1>
|
15 |
+
<h4>
|
16 |
+
<img width="700" alt="teaser" src="https://raw.githubusercontent.com/goksenin-uav/torchreid-pip/main/doc/logo.png">
|
17 |
+
</h4>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
This repo is a packaged version of the [Torchreid](https://github.com/KaiyangZhou/deep-person-reid) algorithm.
|
21 |
+
### Installation
|
22 |
+
```
|
23 |
+
pip install torchreid
|
24 |
+
```
|
25 |
+
|
26 |
+
### Model Description
|
27 |
+
[Learning Generalisable Omni-Scale Representations for Person Re-Identification](https://arxiv.org/abs/1905.00953):
|
28 |
+
[Omni-Scale Feature Learning for Person Re-Identification](https://arxiv.org/abs/1910.06827)
|
29 |
+
[Torchreid: A Library for Deep Learning Person Re-Identification in Pytorch](https://arxiv.org/abs/1910.10093)
|
30 |
+
|
31 |
+
|
32 |
+
### Overview
|
33 |
+
##### 1. Import ``torchreid``
|
34 |
+
```python
|
35 |
+
import torchreid
|
36 |
+
```
|
37 |
+
##### 2. Load data manager
|
38 |
+
|
39 |
+
```python
|
40 |
+
datamanager = torchreid.data.ImageDataManager(
|
41 |
+
root="reid-data",
|
42 |
+
sources="market1501",
|
43 |
+
targets="market1501",
|
44 |
+
height=256,
|
45 |
+
width=128,
|
46 |
+
batch_size_train=32,
|
47 |
+
batch_size_test=100,
|
48 |
+
transforms=["random_flip", "random_crop"]
|
49 |
+
)
|
50 |
+
```
|
51 |
+
##### 3 Build model, optimizer and lr_scheduler
|
52 |
+
|
53 |
+
```python
|
54 |
+
model = torchreid.models.build_model(
|
55 |
+
name="resnet50",
|
56 |
+
num_classes=datamanager.num_train_pids,
|
57 |
+
loss="softmax",
|
58 |
+
pretrained=True
|
59 |
+
)
|
60 |
+
|
61 |
+
model = model.cuda()
|
62 |
+
|
63 |
+
optimizer = torchreid.optim.build_optimizer(
|
64 |
+
model,
|
65 |
+
optim="adam",
|
66 |
+
lr=0.0003
|
67 |
+
)
|
68 |
+
|
69 |
+
scheduler = torchreid.optim.build_lr_scheduler(
|
70 |
+
optimizer,
|
71 |
+
lr_scheduler="single_step",
|
72 |
+
stepsize=20
|
73 |
+
)
|
74 |
+
```
|
75 |
+
##### 4. Build engine
|
76 |
+
|
77 |
+
```python
|
78 |
+
engine = torchreid.engine.ImageSoftmaxEngine(
|
79 |
+
datamanager,
|
80 |
+
model,
|
81 |
+
optimizer=optimizer,
|
82 |
+
scheduler=scheduler,
|
83 |
+
label_smooth=True
|
84 |
+
)
|
85 |
+
```
|
86 |
+
##### 5. Run training and test
|
87 |
+
|
88 |
+
```python
|
89 |
+
engine.run(
|
90 |
+
save_dir="log/resnet50",
|
91 |
+
max_epoch=60,
|
92 |
+
eval_freq=10,
|
93 |
+
print_freq=10,
|
94 |
+
test_only=False
|
95 |
+
)
|
96 |
+
```
|
97 |
+
Citation
|
98 |
+
---------
|
99 |
+
If you use this code or the models in your research, please give credit to the following papers:
|
100 |
+
```bibtex
|
101 |
+
@article{torchreid,
|
102 |
+
title={Torchreid: A Library for Deep Learning Person Re-Identification in Pytorch},
|
103 |
+
author={Zhou, Kaiyang and Xiang, Tao},
|
104 |
+
journal={arXiv preprint arXiv:1910.10093},
|
105 |
+
year={2019}
|
106 |
+
}
|
107 |
+
|
108 |
+
@inproceedings{zhou2019osnet,
|
109 |
+
title={Omni-Scale Feature Learning for Person Re-Identification},
|
110 |
+
author={Zhou, Kaiyang and Yang, Yongxin and Cavallaro, Andrea and Xiang, Tao},
|
111 |
+
booktitle={ICCV},
|
112 |
+
year={2019}
|
113 |
+
}
|
114 |
+
|
115 |
+
@article{zhou2021osnet,
|
116 |
+
title={Learning Generalisable Omni-Scale Representations for Person Re-Identification},
|
117 |
+
author={Zhou, Kaiyang and Yang, Yongxin and Cavallaro, Andrea and Xiang, Tao},
|
118 |
+
journal={TPAMI},
|
119 |
+
year={2021}
|
120 |
+
}
|
121 |
+
```
|