File size: 2,100 Bytes
97aa5af | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | # Dataloaders
This directory contains scripts to generate Simulated datasets for training and testing.
It uses functionalities from `tools` folder to:
`generate_dataset`
- load and downsample data
- compute normals if needed
- apply random transformations
- add augmentations (noise, outliers and occlusion)
- save point clouds
**Note: Two input point clouds must have same length.**
`generate_dataset_dict`
- save generated dataset in dictionaries suitable to train models (following Learning3d requirments)
- checks dimensions (to meet Learning3d requirments)
`combine_dataset_dict`
- shuffle and combine all generated dictionaries into one
- split train and test sets
## How to generate datasets?
Modify the `args.txt` file to contain the correct paths and other specifications e.g. downsampling rate, noise level, etc. Other default arguments in `data_dict_generator.py` can also be changed.
1. Generate transformed target point clouds + GT transforms
Change `--action in dataloader/args.txt` to `generate_dataset` and run:
```
python dataloader/data_dict_generator.py @dataloader/args.txt
```
2. Generate train/test .pkl dicts
Change `--action in dataloader/args.txt` to `generate_dataset_dict`, then run the above script again.
3. Combine multiple object dicts
Set `--action combine_dataset_dict` and run again to get train and test `dict.pkl` files.
### Manual Run (without args.txt)
Optinally you can manually run:
```
python dataloader/data_dict_generator.py \
--pcdPath /path/to/source_scan.pcd \
--cadPath /path/to/object.stl \
--name teeth \
--action generate_dataset \
--every_k_points 100 \
--num_transformation 50 \
--angles 0 90 180 \
--translation_range -1 1 \
--index 0 \
--noise_level 0 \
--outlier_level 0 \
--outlier_bounds -0.05 0.05 \
--occ_level 0 \
--save_path data/simulators
```
then:
```
python dataloader/data_dict_generator.py \
--pcdPath /path/to/source_scan.pcd \
--cadPath /path/to/object.stl \
--name teeth \
--action generate_dataset_dict \
--dataset_size 50 \
--index 0 \
--save_path data/simulators
``` |