README.md 2.56 KB
Newer Older
1
### Prepare ScanNet Data for Indoor Detection or Segmentation Task
Ziyi Wu's avatar
Ziyi Wu committed
2

3
We follow the procedure in [votenet](https://github.com/facebookresearch/votenet/).
liyinhao's avatar
liyinhao committed
4

5
1. Download ScanNet v2 data [HERE](https://github.com/ScanNet/ScanNet). Link or move the 'scans' folder to this level of directory. If you are performing segmentation tasks and want to upload the results to its official [benchmark](http://kaldir.vc.in.tum.de/scannet_benchmark/), please also link or move the 'scans_test' folder to this directory.
liyinhao's avatar
liyinhao committed
6

7
2. In this directory, extract point clouds and annotations by running `python batch_load_scannet_data.py`. Add the `--max_num_point 50000` flag if you only use the ScanNet data for the detection task. It will downsample the scenes to less points.
8

9
10
11
3. In this directory, extract RGB image with poses by running `python extract_posed_images.py`. This step is optional. Skip it if you don't plan to use multi-view RGB images. Add `--max-images-per-scene -1` to disable limiting number of images per scene. ScanNet scenes contain up to 5000+ frames per each. After extraction, all the .jpg images require 2 Tb disk space. The recommended 300 images per scene require less then 100 Gb. For example multi-view 3d detector ImVoxelNet samples 50 and 100 images per training and test scene.

4. Enter the project root directory, generate training data by running
Ziyi Wu's avatar
Ziyi Wu committed
12

13
14
15
```bash
python tools/create_data.py scannet --root-path ./data/scannet --out-dir ./data/scannet --extra-tag scannet
```
liyinhao's avatar
liyinhao committed
16

liyinhao's avatar
liyinhao committed
17
The overall process could be achieved through the following script
Ziyi Wu's avatar
Ziyi Wu committed
18

liyinhao's avatar
liyinhao committed
19
20
```bash
python batch_load_scannet_data.py
21
python extract_posed_images.py 
liyinhao's avatar
liyinhao committed
22
23
24
25
cd ../..
python tools/create_data.py scannet --root-path ./data/scannet --out-dir ./data/scannet --extra-tag scannet
```

26
The directory structure after pre-processing should be as below
Ziyi Wu's avatar
Ziyi Wu committed
27

liyinhao's avatar
liyinhao committed
28
29
30
```
scannet
├── scannet_utils.py
31
├── batch_load_scannet_data.py
liyinhao's avatar
liyinhao committed
32
├── load_scannet_data.py
33
├── scannet_utils.py
liyinhao's avatar
liyinhao committed
34
35
├── README.md
├── scans
36
37
├── scans_test
├── scannet_instance_data
38
├── points
twang's avatar
twang committed
39
│   ├── xxxxx.bin
40
├── instance_mask
twang's avatar
twang committed
41
│   ├── xxxxx.bin
42
├── semantic_mask
twang's avatar
twang committed
43
│   ├── xxxxx.bin
44
45
46
47
48
├── seg_info
│   ├── train_label_weight.npy
│   ├── train_resampled_scene_idxs.npy
│   ├── val_label_weight.npy
│   ├── val_resampled_scene_idxs.npy
49
50
51
52
53
├── posed_images
│   ├── scenexxxx_xx
│   │   ├── xxxxxx.txt
│   │   ├── xxxxxx.jpg
│   │   ├── intrinsic.txt
54
55
├── scannet_infos_train.pkl
├── scannet_infos_val.pkl
56
├── scannet_infos_test.pkl
liyinhao's avatar
liyinhao committed
57
58

```