Update README.md
Browse files
README.md
CHANGED
|
@@ -38,6 +38,15 @@ conda install pytorch torchvision cudatoolkit=9.0 -c pytorch
|
|
| 38 |
python setup.py develop
|
| 39 |
```
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
Use Torchreid as a feature extractor in your project.
|
| 42 |
|
| 43 |
```python
|
|
@@ -45,7 +54,7 @@ from torchreid.utils import FeatureExtractor
|
|
| 45 |
|
| 46 |
extractor = FeatureExtractor(
|
| 47 |
model_name='osnet_x1_0',
|
| 48 |
-
model_path='a/b/c/model.pth
|
| 49 |
device='cuda'
|
| 50 |
)
|
| 51 |
|
|
@@ -59,4 +68,20 @@ image_list = [
|
|
| 59 |
|
| 60 |
features = extractor(image_list)
|
| 61 |
print(features.shape) # output (5, 512)
|
| 62 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
python setup.py develop
|
| 39 |
```
|
| 40 |
|
| 41 |
+
Download OSNet models.
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
from huggingface_hub import snapshot_download
|
| 45 |
+
|
| 46 |
+
# This will download the entire repo (containing all models) to cache_dir
|
| 47 |
+
snapshot_download(repo_id="kaiyangzhou/osnet", cache_dir="./")
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
Use Torchreid as a feature extractor in your project.
|
| 51 |
|
| 52 |
```python
|
|
|
|
| 54 |
|
| 55 |
extractor = FeatureExtractor(
|
| 56 |
model_name='osnet_x1_0',
|
| 57 |
+
model_path='a/b/c/model.pth',
|
| 58 |
device='cuda'
|
| 59 |
)
|
| 60 |
|
|
|
|
| 68 |
|
| 69 |
features = extractor(image_list)
|
| 70 |
print(features.shape) # output (5, 512)
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
# Model list
|
| 74 |
+
|
| 75 |
+
Models pre-trained on ImageNet are named in the following format: `osnet_x<scale>_imagenet.pth`.
|
| 76 |
+
|
| 77 |
+
Available re-id models:
|
| 78 |
+
- osnet_ain_x1_0_msmt17_256x128_amsgrad_ep50_lr0.0015_coslr_b64_fb10_softmax_labsmth_flip_jitter.pth
|
| 79 |
+
- osnet_ibn_x1_0_msmt17_combineall_256x128_amsgrad_ep150_stp60_lr0.0015_b64_fb10_softmax_labelsmooth_flip_jitter.pth
|
| 80 |
+
- osnet_x1_0_msmt17_combineall_256x128_amsgrad_ep150_stp60_lr0.0015_b64_fb10_softmax_labelsmooth_flip_jitter.pth
|
| 81 |
+
- osnet_x0_75_msmt17_combineall_256x128_amsgrad_ep150_stp60_lr0.0015_b64_fb10_softmax_labelsmooth_flip_jitter.pth
|
| 82 |
+
- osnet_x0_5_msmt17_combineall_256x128_amsgrad_ep150_stp60_lr0.0015_b64_fb10_softmax_labelsmooth_flip_jitter.pth
|
| 83 |
+
- osnet_x0_25_msmt17_combineall_256x128_amsgrad_ep150_stp60_lr0.0015_b64_fb10_softmax_labelsmooth_flip_jitter.pth
|
| 84 |
+
|
| 85 |
+
`ain` and `ibn` models are more generalizable. Please refer to https://arxiv.org/abs/1910.06827.
|
| 86 |
+
|
| 87 |
+
`osnet_x1_0`, `osnet_x0_75`, `osnet_x0_5`, and `osnet_x0_25` are OSNet models of different sizes. Please refer to https://arxiv.org/abs/1905.00953.
|