23 |
24 | ## Interactive Demo
25 | We provide an [interactive demo](https://huggingface.co/spaces/kaifz/pgnd) in Huggingface Spaces.
26 |
27 | ## Installation
28 |
29 | ### Prerequisite
30 |
31 | We recommend installing the latest version of CUDA (12.x) and PyTorch. The CUDA version used to compile PyTorch should be the same as the system's CUDA version to enable installation of the ```diff_gaussian_rasterizer``` package.
32 |
33 | ### Setup an environment
34 |
35 | 1. Prepare python environment
36 | ```
37 | conda create -n pgnd python=3.10
38 | conda activate pgnd
39 | ```
40 |
41 | 2. Install PyTorch: [https://pytorch.org/get-started/locally/](https://pytorch.org/get-started/locally/)
42 | ```
43 | conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.4 -c pytorch -c nvidia
44 | ```
45 |
46 | 3. Install other packages:
47 | ```
48 | pip install -r requirements.txt
49 | conda install -c dglteam/label/th24_cu124 dgl
50 | conda install conda-forge::ffmpeg
51 | ```
52 |
53 | 4. Install diff_gaussian_rasterization:
54 | ```
55 | cd third_party/diff-gaussian-rasterization-w-depth
56 | pip install -e .
57 | ```
58 |
59 | ## Data and Checkpoints
60 | The dataset and pre-trained checkpoint files could be downloaded from [this link](https://drive.google.com/drive/folders/10E0gpETbwA8d1XntIsP0fgWGHipndAe8?usp=sharing).
61 |
62 | For the dataset, We provide the full training and evaluation datasets for all six categories. The dataset is stored as a zip file for each category, e.g. for box, all the data are stored in data_box.zip. The files should be unzipped and organized as the following (take box and sloth as examples; suppose the data for these two categories are downloaded):
63 | ```
64 | - experiments/log/data
65 | - 0112_box_processed
66 | - 0112_box2_processed
67 | - 0112_box3_processed
68 | - 1018_sloth_processed
69 | - box_merged
70 | - sloth_merged
71 | ...
72 | ```
73 | For the checkpoints, the files should be unzipped and organized as the following:
74 | ```
75 | - experiments/log
76 | - box
77 | - train
78 | - ckpts
79 | - 100000.pt
80 | - hydra.yaml
81 | - sloth
82 | - train
83 | - ckpts
84 | - 100000.pt
85 | - hydra.yaml
86 | ...
87 | ```
88 | The path needs to match exactly for training and inference scripts to work. If you need to use data in a different format, you may need to directly modify the code to accomodate.
89 |
90 | ## Custom Dataset
91 |
92 | For processing data from raw RGB-D recordings, the following pre-trained detection, segmentation, and tracking models are required. These can be installed by:
93 | ```
94 | pip install iopath
95 | pip install segment-anything
96 | pip install --no-deps git+https://github.com/IDEA-Research/GroundingDINO
97 | pip install --no-deps git+https://github.com/facebookresearch/sam2
98 | pip install --no-deps git+https://github.com/facebookresearch/co-tracker
99 | ```
100 | And the weights can be downloaded from [this link](https://drive.google.com/drive/folders/1Z70RgW7oiTIfvdk_qOOtqDGsMFQ0jimY?usp=sharing). Extract files and put them in the ```weights/``` folder.
101 |
102 | The raw data should contain multi-view rgb and depth image recordings, and robot end-effector translation/rotation/gripper openness recordings. An example of raw data is available at
103 | [this link](https://drive.google.com/drive/folders/1QQ2ftIJZWFGzBeFg3bxqy6ktsUgmsHts?usp=drive_link) and could be extracted to ```experiments/log/data/cloth_test```.
104 |
105 | For data processing, the following command runs the data processing code and generates the processed dataset with point tracks:
106 | ```
107 | python experiments/real_world/postprocess.py
108 | ```
109 |
110 | ## Training
111 | Once the datasets are prepared, we provide training scripts in the ```experiments/scripts``` folder.
112 | ```
113 | bash experiments/scripts/train_@Article{kerbl3Dgaussians,
37 | author = {Kerbl, Bernhard and Kopanas, Georgios and Leimk{\"u}hler, Thomas and Drettakis, George},
38 | title = {3D Gaussian Splatting for Real-Time Radiance Field Rendering},
39 | journal = {ACM Transactions on Graphics},
40 | number = {4},
41 | volume = {42},
42 | month = {July},
43 | year = {2023},
44 | url = {https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/}
45 | }
46 |