Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Shengcai Liao committed Apr 1, 2021
1 parent 9217f41 commit 3c6168c
Showing 1 changed file with 156 additions and 95 deletions.
251 changes: 156 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ This PyTorch code is proposed in our paper [1]. A Chinese blog is available in [

# Updates

* 3/31/2021: Include some popular data augmentation methods, and change the ranking.py implementation to the original open-reid version, so that it is more consistent to most other implementations (e.g. open-reid, torch-reid, fast-reid).
* 2/7/2021: An important update: include a pre-training function for a better initialization, so that the [results](#Performance) are now more stable.
* 4/1/2021: QAConv 2.0: include a new sampler called Graph Sampler (GS), and remove the class memory. This version is much more efficient in learning. See the updated [results](#Performance).
* 3/31/2021: QAConv 1.2: include some popular data augmentation methods, and change the ranking.py implementation to the original open-reid version, so that it is more consistent to most other implementations (e.g. open-reid, torch-reid, fast-reid).
* 2/7/2021: QAConv 1.1: an important update, which includes a pre-training function for a better initialization, so that the [results](#Performance) are now more stable.
* 11/26/2020: Include the IBN-Net as backbone, and the [RandPerson](https://github.com/VideoObjectSearch/RandPerson) dataset.

# Requirements
Expand All @@ -16,138 +17,198 @@ This PyTorch code is proposed in our paper [1]. A Chinese blog is available in [
- scipy

# Usage
Download some public datasets (e.g. Market-1501, DukeMTMC-reID, CUHK03-NP, MSMT) on your own, extract them in some
Download some public datasets (e.g. Market-1501, CUHK03-NP, MSMT) on your own, extract them in some
folder, and then run the followings.

## Training and test
python main.py --dataset market --testset duke[,market,msmt] [--data-dir ./data] [--exp-dir ./Exp]
`python main.py --dataset market --testset cuhk03_np_detected[,msmt] [--data-dir ./data] [--exp-dir ./Exp]`

For more options, run "python main.py --help". For example, if you want to use the ResNet-152 as backbone, specify "-a resnet152". If you want to train on the whole dataset (as done in our paper for the MSMT17), specify "--combine_all".

With the GS sampler and pairwise matching loss, run the following:

``python main_gs.py --dataset market --testset cuhk03_np_detected[,msmt] [--data-dir ./data] [--exp-dir ./Exp]``

## Test only
python main.py --dataset market --testset duke[,market,msmt] [--data-dir ./data] [--exp-dir ./Exp] --evaluate
`python main.py --dataset market --testset duke[,market,msmt] [--data-dir ./data] [--exp-dir ./Exp] --evaluate`

# Performance

* Updated performance (%) of QAConv under direct cross-dataset evaluation without transfer learning or domain adaptation:
<table>
<tr>
<td rowspan="3">Backbone</td>
<td rowspan="3">Training set</td>
<td colspan="8" align="center">Test set</td>
</tr>
<tr>
<td colspan="2" align="center">Market</td>
<td colspan="2" align="center">Duke</td>
<td colspan="2" align="center">CUHK</td>
<td colspan="2" align="center">MSMT</td>
Updated performance (%) of QAConv under direct cross-dataset evaluation without transfer learning or domain adaptation:

<table align="center">
<tr align="center">
<td rowspan="2">Training Data</td>
<td rowspan="2">Version</td>
<td rowspan="2">Training Time (h)</td>
<td colspan="2">CUHK03-NP</td>
<td colspan="2">Market-1501</td>
<td colspan="2">MSMT17</td>
</tr>
<tr>
<td>Rank-1</td>
<td>mAP</td>
<tr align="center">
<td>Rank-1</td>
<td>mAP</td>
<td>Rank-1</td>
<td>mAP</td>
<td>Rank-1</td>
<td>mAP</td>
</tr>
<tr>
<td rowspan="3">ResNet-50</td>
<td>Market</td>
<tr align="center">
<td rowspan="4">Market</td>
<td>QAConv 1.0</td>
<td>1.33</td>
<td>9.9</td>
<td>8.6</td>
<td>-</td>
<td>-</td>
<td>22.6</td>
<td>7.0</td>
</tr>
<tr align="center">
<td>QAConv 1.1</td>
<td>1.02</td>
<td>12.4</td>
<td>11.3</td>
<td>-</td>
<td>-</td>
<td>35.6</td>
<td>12.2</td>
</tr>
<tr align="center">
<td>QAConv 1.2</td>
<td>1.07</td>
<td>13.3</td>
<td>14.2</td>
<td>-</td>
<td>-</td>
<td>49.5</td>
<td>29.7</td>
<td>10.6</td>
<td>9.3</td>
<td>26.4</td>
<td>8.3</td>
<td>40.9</td>
<td>14.7</td>
</tr>
<tr>
<td>MSMT (all)</td>
<td>73.8</td>
<td>44.1</td>
<td>69.7</td>
<td>51.8</td>
<td>24.6</td>
<td>22.8</td>
<tr align="center">
<td>QAConv 2.0</td>
<td><b>0.68</b></td>
<td><b>16.4</b></td>
<td><b>15.7</b></td>
<td>-</td>
<td>-</td>
<td><b>41.2</b></td>
<td><b>15.0</b></td>
</tr>
<tr>
<td>RandPerson</td>
<td>65.6</td>
<td>34.8</td>
<td>59.4</td>
<td>36.1</td>
<td>14.3</td>
<td>11.0</td>
<td>34.3</td>
<td>10.7</td>
<tr align="center">
<td rowspan="2">MSMT</td>
<td>QAConv 1.2</td>
<td>2.37</td>
<td>15.6</td>
<td>16.2</td>
<td>72.9</td>
<td>44.2</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td rowspan="3">IBN-Net-b (ResNet-50)</td>
<td>Market</td>
<tr align="center">
<td>QAConv 2.0</td>
<td><b>0.96</b></td>
<td><b>20.0</b></td>
<td><b>19.2</b></td>
<td><b>75.1</b></td>
<td><b>46.7</b></td>
<td>-</td>
<td>-</td>
<td>54.0</td>
<td>35.0</td>
<td>12.4</td>
<td>11.3</td>
<td>35.6</td>
<td>12.2</td>
</tr>
<tr>
<td>MSMT (all)</td>
<td>76.0</td>
<td>47.9</td>
<td>71.6</td>
<td>53.6</td>
<tr align="center">
<td rowspan="4">MSMT (all)</td>
<td>QAConv 1.0</td>
<td>26.90</td>
<td>25.3</td>
<td>22.6</td>
<td>72.6</td>
<td>43.1</td>
<td>-</td>
<td>-</td>
</tr>
<tr align="center">
<td>QAConv 1.1</td>
<td>18.16</td>
<td>27.1</td>
<td>25.0</td>
<td>76.0</td>
<td>47.9</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>RandPerson</td>
<td>68.0</td>
<td>36.8</td>
<td>61.7</td>
<td>38.9</td>
<tr align="center">
<td>QAConv 1.2</td>
<td>17.85</td>
<td>25.1</td>
<td>24.8</td>
<td>79.5</td>
<td>52.3</td>
<td>-</td>
<td>-</td>
</tr>
<tr align="center">
<td>QAConv 2.0</td>
<td><b>3.88</b></td>
<td><b>27.2</b></td>
<td><b>27.1</b></td>
<td><b>80.6</b></td>
<td><b>55.6</b></td>
<td>-</td>
<td>-</td>
</tr>
<tr align="center">
<td rowspan="3">RandPerson</td>
<td>QAConv 1.1</td>
<td>12.05</td>
<td>12.9</td>
<td>10.8</td>
<td>68.0</td>
<td>36.8</td>
<td>36.6</td>
<td>12.1</td>
</tr>
<tr align="center">
<td>QAConv 1.2</td>
<td>12.22</td>
<td>12.6</td>
<td>12.1</td>
<td>73.2</td>
<td>42.1</td>
<td>41.8</td>
<td>13.8</td>
</tr>
<tr align="center">
<td>QAConv 2.0</td>
<td><b>1.84</b></td>
<td><b>14.8</b></td>
<td><b>13.4</b></td>
<td><b>74.0</b></td>
<td><b>43.8</b></td>
<td><b>42.4</b></td>
<td><b>14.4</b></td>
</tr>
</table>

Note: results are obtained by neck=64, batch_size=8, lr=0.005, epochs=15, and step_size=10 (except for RandPerson epochs=4 and step_size=2), trained on one single GPU. By this setting the traininig and testing time and memory is much reduced.

* Performance (%) of QAConv in the ECCV paper, with ResNet-152 under direct cross-dataset evaluation:

| Method | Training set | Test set | Rank-1 | mAP |
| :----: | :----------: | :------: | :----: | :---: |
| QAConv | Market | Duke | 54.4 | 33.6 |
| QAConv + RR + TLift | Market | Duke | 70.0 | 61.2 |
| |
| QAConv | MSMT | Duke | 72.2 | 53.4 |
| QAConv + RR + TLift | MSMT | Duke | 82.2 | 78.4 |
| |
| QAConv | Duke | Market | 62.8 | 31.6 |
| QAConv + RR + TLift | Duke | Market | 78.7 | 58.2 |
| |
| QAConv | MSMT | Market | 73.9 | 46.6 |
| QAConv + RR + TLift | MSMT | Market | 88.4 | 76.0 |
| |
| QAConv | Market | MSMT | 25.6 | 8.2 |
| QAConv | Duke | MSMT | 32.7 | 10.4 |
| |
| QAConv | Market | CUHK03-NP | 14.1 | 11.8 |
| QAConv | Duke | CUHK03-NP | 11.0 | 9.4 |
| QAConv | MSMT | CUHK03-NP | 32.6 | 28.1 |

# Pre-trained Models

**Version Difference:**

| Version | Backbone | IBN Type | Pre-trials | Loss | Sampler | Data Augmentation |
| ---------- | --------- | -------- | ---------- | ----------------- | ------- | ----------------- |
| QAConv 1.0 | ResNet-50 | None | x | Class Memory | Random | Old |
| QAConv 1.1 | ResNet-50 | b || Class Memory | Random | Old |
| QAConv 1.2 | ResNet-50 | b || Class Memory | Random | New |
| QAConv 2.0 | ResNet-50 | b | x | Pairwise Matching | GS | New |

**Notes:**

* Except QAConv 1.0, the other versions additionally include three IN layers as in IBN-Net-b.
* QAConv 1.1 and 1.2 additionally include a pre-training function with 10 trials to stable the results.
* QAConv 1.2 and 2.0 additionally apply some popular data augmentation methods.
* QAConv 2.0 applies the GS sampler and the pairwise matching loss.
* QAConv 1.0 results are obtained by neck=128, batch_size=32, lr=0.01, epochs=60, and step_size=40, trained with two V100.
* QAConv 1.1 and 1.2 results are obtained by neck=64, batch_size=8, lr=0.005, epochs=15, and step_size=10 (except for RandPerson epochs=4 and step_size=2), trained on one single V100.
* QAConv 2.0 results are obtained by neck=64, batch_size=64, K=4, lr=0.001, epochs=15, and step_size=10 (except for RandPerson epochs=4 and step_size=2), trained on one single V100.

# Pre-trained Models for QAConv 1.0 on ECCV 2020

- [QAConv_ResNet50_MSMT](https://1drv.ms/u/s!Ak6Huh3i3-MzdRN84Kd6Xrn5FXg?e=cJmCui)
- [QAConv_ResNet152_MSMT](https://1drv.ms/u/s!Ak6Huh3i3-MzdhATpabUgh5f2aY?e=RD8tRV)
Expand Down

0 comments on commit 3c6168c

Please # to comment.