Diff of /docs/2.prepare_dataset.md [000000] .. [fd9ef4]

Switch to unified view

a b/docs/2.prepare_dataset.md
1
# Prepare dataset
2
Suppose you have downloaded the original dataset, we need to preprocess the data and save it as pickle file. Remember to set your path to the root of processed dataset in [configs/*.yaml](configs/).
3
4
## Preprocess
5
**CASIA-B** 
6
7
Download URL: http://www.cbsr.ia.ac.cn/GaitDatasetB-silh.zip
8
- Original
9
    ```
10
    CASIA-B
11
        001 (subject)
12
            bg-01 (type)
13
                000 (view)
14
                    001-bg-01-000-001.png (frame)
15
                    001-bg-01-000-002.png (frame)
16
                    ......
17
                ......
18
            ......
19
        ......
20
    ```
21
- Run `python datasets/pretreatment.py --input_path CASIA-B --output_path CASIA-B-pkl`
22
- Processed
23
    ```
24
    CASIA-B-pkl
25
        001 (subject)
26
            bg-01 (type)
27
                    000 (view)
28
                        000.pkl (contains all frames)
29
                ......
30
            ......
31
        ......
32
    ```
33
**OUMVLP** 
34
35
Step1: Download URL: http://www.am.sanken.osaka-u.ac.jp/BiometricDB/GaitMVLP.html
36
37
Step2: Unzip the dataset, you will get a structure directory like:
38
```
39
python datasets/OUMVLP/extractor.py --input_path Path_of_OUMVLP-base --output_path Path_of_OUMVLP-raw --password Given_Password
40
```  
41
42
- Original
43
    ```
44
    OUMVLP-raw
45
        Silhouette_000-00 (view-sequence)
46
            00001 (subject)
47
                0001.png (frame)
48
                0002.png (frame)
49
                ......
50
            00002
51
                0001.png (frame)
52
                0002.png (frame)
53
                ......
54
            ......
55
        Silhouette_000-01
56
            00001
57
                0001.png (frame)
58
                0002.png (frame)
59
                ......
60
            00002
61
                0001.png (frame)
62
                0002.png (frame)
63
                ......
64
            ......
65
        Silhouette_015-00
66
            ......
67
        Silhouette_015-01
68
            ......
69
        ......
70
    ```
71
Step3 : To rearrange directory of OUMVLP dataset, turning to id-type-view structure, Run 
72
```
73
python datasets/OUMVLP/rearrange_OUMVLP.py --input_path Path_of_OUMVLP-raw --output_path Path_of_OUMVLP-rearranged
74
```  
75
76
Step4: Transforming images to pickle file, run 
77
```
78
python datasets/pretreatment.py --input_path Path_of_OUMVLP-rearranged --output_path Path_of_OUMVLP-pkl
79
```
80
81
- Processed
82
    ```
83
    OUMVLP-pkl
84
        00001 (subject)
85
            00 (sequence)
86
                000 (view)
87
                    000.pkl (contains all frames)
88
                015 (view)
89
                    015.pkl (contains all frames)
90
                ...
91
            01 (sequence)
92
                000 (view)
93
                    000.pkl (contains all frames)
94
                015 (view)
95
                    015.pkl (contains all frames)
96
                ......
97
        00002 (subject)
98
            ......
99
        ......
100
    ```
101
102
103
**GREW** 
104
105
Step1: Download the data
106
107
Step2: [Unzip](https://github.com/GREW-Benchmark/GREW-Benchmark) the dataset, you will get a structure directory like:
108
109
- Original
110
    ```
111
    GREW-raw
112
    ├── train
113
        ├── 00001
114
            ├── 4XPn5Z28
115
                ├── 00001.png
116
                ├── 00001_2d_pose.txt
117
                ├── 00001_3d_pose.txt
118
            ├── 4XPn5Z28_gei.png
119
    ├── test
120
        ├── gallery
121
            ├── 00001
122
                ├── 79XJefi8
123
                    ├── 00001.png
124
                    ├── 00001_2d_pose.txt
125
                    ├── 00001_3d_pose.txt
126
                ├── 79XJefi8_gei.png
127
        ├── probe
128
            ├── 01DdvEHX
129
                ├── 00001.png
130
                ├── 00001_2d_pose.txt
131
                ├── 00001_3d_pose.txt
132
            ├── 01DdvEHX_gei.png
133
        ...
134
    ...
135
            
136
Step3 : To rearrange directory of GREW dataset, turning to id-type-view structure, Run 
137
```
138
python datasets/GREW/rearrange_GREW.py --input_path Path_of_GREW-raw --output_path Path_of_GREW-rearranged
139
```  
140
141
Step4: Transforming images to pickle file, run 
142
```
143
python datasets/pretreatment.py --input_path Path_of_GREW-rearranged --output_path Path_of_GREW-pkl
144
```
145
146
- Processed
147
    ```
148
    GREW-pkl
149
    ├── 00001train (subject in training set)
150
        ├── 00
151
            ├── 4XPn5Z28
152
                ├── 4XPn5Z28.pkl
153
            ├──5TXe8svE
154
                ├── 5TXe8svE.pkl
155
                ......
156
    ├── 00001 (subject in testing set)
157
        ├── 01
158
            ├── 79XJefi8
159
                ├── 79XJefi8.pkl
160
        ├── 02
161
            ├── t16VLaQf
162
                ├── t16VLaQf.pkl
163
    ├── probe
164
        ├── etaGVnWf
165
            ├── etaGVnWf.pkl
166
        ├── eT1EXpgZ
167
            ├── eT1EXpgZ.pkl
168
        ...
169
    ...
170
    ```
171
172
## Split dataset
173
You can use the partition file in dataset folder directly, or you can create yours. Remember to set your path to the partition file in [configs/*.yaml](configs/).