Skip to content

Commit 9c0ff76

Browse files
authored
Add files via upload
1 parent 992c852 commit 9c0ff76

11 files changed

+1197
-0
lines changed

config.py

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
import configargparse
2+
import numpy as np
3+
import os
4+
5+
6+
def config_parser():
7+
parser = configargparse.ArgumentParser()
8+
9+
# Experiment Setup
10+
parser.add_argument('--config', is_config_file=True, default='configs/syn.txt',
11+
help='config file path')
12+
parser.add_argument("--exp_name", type=str, default=None,
13+
help='Experiment name, used as folder name for the experiment. If left blank, a \
14+
name will be auto generated based on the configuration settings.')
15+
parser.add_argument("--log_dir", type=str, default=None,
16+
help='start time')
17+
parser.add_argument("--data_dir", type=str,
18+
help='input data directory')
19+
parser.add_argument("--raw_data_dir", type=str,
20+
help='raw data directory')
21+
parser.add_argument("--input_data_glob", type=str,
22+
help='glob expression to find raw input files')
23+
parser.add_argument("--split_file", type=str,
24+
help='Path to read and write the data split file. Needs to end with ".npz"')
25+
26+
# Training Data Parameters
27+
parser.add_argument("--sample_std_dev", action='append', type=float,
28+
help='Standard deviations of gaussian samples. \
29+
Used for displacing surface points to sample the distance field.')
30+
parser.add_argument("--sample_ratio", action='append', type=float,
31+
help='Ratio of standard deviations for samples used for training. \
32+
Needs to have the same len as sample_std with floats between 0-1 \
33+
and summing to 1.')
34+
parser.add_argument("--bb_min", default=-0.5, type=float,
35+
help='Training and testing shapes are normalized to be in a common bounding box.\
36+
This value defines the min value in x,y and z for the bounding box.')
37+
parser.add_argument("--bb_max", default=0.5, type=float,
38+
help='Training and testing shapes are normalized to be in a common bounding box.\
39+
This value defines the max value in x,y and z for the bounding box.')
40+
parser.add_argument("--input_res", type=int, default=256,
41+
help='Training and testing shapes are normalized to be in a common bounding box.\
42+
This value defines the max value in x,y and z for the bounding box.')
43+
parser.add_argument("--num_points", type=int, default=10000,
44+
help='Number of points sampled from each ground truth shape.')
45+
46+
# Preprocessing - Multiprocessing
47+
parser.add_argument("--num_chunks", type=int, default=1,
48+
help='The preprocessing can be distributed over num_chunks multiple machines.\
49+
For this the raw files are split into num_chunks chunks. \
50+
Default is preprocessing on a single machine.')
51+
parser.add_argument("--current_chunk", type=int, default=0,
52+
help='Tells the script which chunk it should process. \
53+
Value between 0 till num_chunks-1.')
54+
parser.add_argument("--num_cpus", type=int, default=-1,
55+
help='Number of cpu cores to use for running the script. \
56+
Default is -1, that is, using all available cpus.')
57+
parser.add_argument("--res", type=int, default=128)
58+
59+
# Creating a data test/train/validation split
60+
parser.add_argument('--class_folders', type=str, default=None,
61+
help='If set to None, the split is created by creating a random sample from all input files. '
62+
'If not None, the split is created per class of objects. Objects of the same class need to '
63+
'be in a common parent folder for this. Variable class_folder is interpreted as glob '
64+
'pattern, suffix of data_dir - i.e. data_dir + class_folder, e.g. class_folder="/*/".')
65+
66+
parser_nval = parser.add_mutually_exclusive_group()
67+
parser_nval.add_argument('--n_val', type=int,
68+
help='Size of validation set.')
69+
parser_nval.add_argument('--r_val', type=float, default=0.1,
70+
help='Relative size of validation set.')
71+
72+
parser_ntest = parser.add_mutually_exclusive_group()
73+
parser_ntest.add_argument('--n_test', type=int,
74+
help='Size of test set.')
75+
parser_ntest.add_argument('--r_test', type=float, default=0.2,
76+
help='Relative size of test set.')
77+
78+
# Generation
79+
parser.add_argument("--num_sample_points_generation", type=int, default=50000,
80+
help='Number of point samples per object provided to the RangeUDF network during generation.\
81+
Influences generation speed (larger batches result in faster generation) but also GPU \
82+
memory usage (higher values need more memory). Tip: choose largest possible value on GPU.')
83+
84+
# Network
85+
parser.add_argument("--label_mode", type=str, default='full',
86+
help='loss join type')
87+
parser.add_argument("--joint_mode", type=str, default='naive')
88+
parser.add_argument("--in_dim", type=int, default=3,
89+
help='Number of layers')
90+
parser.add_argument("--concat", type=int, default=3,
91+
help='Number of layers')
92+
parser.add_argument("--rotate", type=int, default=1)
93+
parser.add_argument("--num_layers", type=int, default=4,
94+
help='Number of layers')
95+
parser.add_argument("--sub_sampling_ratio", nargs='+', type=int)
96+
parser.add_argument("--d_out", nargs='+', type=int,help="encoder dims")
97+
parser.add_argument("--num_neighbors", type=int, default=8,
98+
help='Number of neighbors for encoder')
99+
parser.add_argument("--num_interp", type=int, default=8,
100+
help='Number of neighbors for interpolation')
101+
parser.add_argument("--dropout", action='store_true')
102+
parser.add_argument("--fixed_input", action='store_true')
103+
parser.add_argument("--fixed_random_seed", action='store_true')
104+
parser.add_argument("--fixed_cudnn", action='store_true')
105+
106+
parser.add_argument("--rec_loss", type=int, default=1)
107+
parser.add_argument("--sem_loss", type=str, default='ori')
108+
parser.add_argument("--reg_term", type=str, default='on')
109+
parser.add_argument("--reg_coef", type=float, default=0)
110+
parser.add_argument("--sem_term", type=str, default='off')
111+
parser.add_argument("--sem_coef", type=float, default=0)
112+
parser.add_argument("--hidden_dim", type=int,default=512)
113+
parser.add_argument("--rec_hidden_dims", nargs='+',type=int)
114+
parser.add_argument("--sem_hidden_dims", nargs='+',type=int)
115+
parser.add_argument("--rec_hidden_layers", type=int,default=1)
116+
parser.add_argument("--sem_hidden_layers", type=int,default=1)
117+
parser.add_argument("--task", type=str,default='rec') #rec,sem,joint
118+
parser.add_argument("--distance", action='store_false')#attention pooling with or without distance
119+
120+
# Training
121+
parser.add_argument("--ckpt", type=str, default=None, help='which split to train on?')
122+
parser.add_argument("--num_sample_points_training", type=int, default=50000,
123+
help='Number of point samples per object provided to the RangeUDF network during training.\
124+
Influences training speed (larger batches result in shorter epochs) but also GPU \
125+
memory usage (higher values need more memory). Needs to be balanced with batch_size.')
126+
127+
parser.add_argument("--batch_size", type=int, default=4,
128+
help='Number of objects provided to the RangeUDF network in one batch during training.\
129+
Influences training speed (larger batches result in shorter epochs) but also GPU \
130+
memory usage (higher values need more memory). Needs to be balanced with \
131+
num_sample_points_training')
132+
parser.add_argument("--num_epochs", type=int, default=1000,
133+
help='Stopping citron for duration of training. Model converges much earlier: model convergence\
134+
can be checked via tensorboard and is logged within the experiment folder.')
135+
parser.add_argument("--lr", type=float, default=1e-3,
136+
help='Learning rate used during training.')
137+
parser.add_argument("--gamma", type=float, default=1,
138+
help='Learning rate used during training.')
139+
parser.add_argument("--optimizer", type=str, default='Adam',
140+
help='Optimizer used during training.')
141+
parser.add_argument("--max_dist", type=float, default=0.1,
142+
help='max_distance for calculate rec loss')
143+
144+
return parser
145+
146+
147+
def get_config():
148+
parser = config_parser()
149+
cfg = parser.parse_args()
150+
args = vars(cfg)
151+
print('------------ Options -------------')
152+
for k, v in sorted(args.items()):
153+
print('%s: %s' % (str(k), str(v)))
154+
print('-------------- End ---------------')
155+
156+
157+
cfg.sample_ratio = np.array(cfg.sample_ratio)
158+
cfg.sample_std_dev = np.array(cfg.sample_std_dev)
159+
160+
assert np.sum(cfg.sample_ratio) == 1
161+
assert np.any(cfg.sample_ratio < 0) == False
162+
assert len(cfg.sample_ratio) == len(cfg.sample_std_dev)
163+
164+
if cfg.exp_name is None:
165+
cfg.exp_name = 'data-{}dist-{}sigmas-{}res-{}'.format(
166+
os.path.basename(cfg.data_dir),
167+
''.join(str(e) + '_' for e in cfg.sample_ratio),
168+
''.join(str(e) + '_' for e in cfg.sample_std_dev),
169+
cfg.input_res)
170+
171+
return cfg

environment.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: rangeudf
2+
channels:
3+
- conda-forge
4+
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
5+
- defaults
6+
dependencies:
7+
- _libgcc_mutex=0.1=main
8+
- _openmp_mutex=5.1=1_gnu
9+
- ca-certificates=2023.7.22=hbcca054_0
10+
- igl=2.2.1=py38h52fb889_1
11+
- ld_impl_linux-64=2.38=h1181459_1
12+
- libblas=3.9.0=15_linux64_openblas
13+
- libcblas=3.9.0=15_linux64_openblas
14+
- libffi=3.4.4=h6a678d5_0
15+
- libgcc-ng=11.2.0=h1234567_1
16+
- libgfortran-ng=13.1.0=h69a702a_0
17+
- libgfortran5=13.1.0=h15d22d2_0
18+
- libgomp=11.2.0=h1234567_1
19+
- liblapack=3.9.0=15_linux64_openblas
20+
- libopenblas=0.3.20=pthreads_h78a6416_0
21+
- libstdcxx-ng=11.2.0=h1234567_1
22+
- ncurses=6.4=h6a678d5_0
23+
- openssl=3.0.9=h7f8727e_0
24+
- pip=23.1.2=py38h06a4308_0
25+
- python=3.8.17=h955ad1f_0
26+
- python_abi=3.8=2_cp38
27+
- readline=8.2=h5eee18b_0
28+
- setuptools=67.8.0=py38h06a4308_0
29+
- sqlite=3.41.2=h5eee18b_0
30+
- tk=8.6.12=h1ccaba5_0
31+
- wheel=0.38.4=py38h06a4308_0
32+
- xz=5.4.2=h5eee18b_0
33+
- zlib=1.2.13=h5eee18b_0
34+
- pip:
35+
- absl-py==1.4.0
36+
- addict==2.4.0
37+
- ansi2html==1.8.0
38+
- asttokens==2.2.1
39+
- attrs==23.1.0
40+
- backcall==0.2.0
41+
- beautifulsoup4==4.12.2
42+
- cachetools==5.3.1
43+
- certifi==2023.7.22
44+
- chardet==5.1.0
45+
- charset-normalizer==3.2.0
46+
- click==8.1.6
47+
- comm==0.1.4
48+
- configargparse==1.7
49+
- contourpy==1.1.0
50+
- cycler==0.11.0
51+
- cython==3.0.0
52+
- dash==2.11.1
53+
- dash-core-components==2.0.0
54+
- dash-html-components==2.0.0
55+
- dash-table==5.0.0
56+
- decorator==5.1.1
57+
- executing==1.2.0
58+
- fastjsonschema==2.18.0
59+
- filelock==3.12.2
60+
- flask==2.2.5
61+
- fonttools==4.42.0
62+
- freetype-py==2.4.0
63+
- gdown==4.7.1
64+
- google-api-core==2.11.1
65+
- google-api-python-client==2.95.0
66+
- google-auth==2.22.0
67+
- google-auth-httplib2==0.1.0
68+
- google-auth-oauthlib==1.0.0
69+
- googleapis-common-protos==1.60.0
70+
- grpcio==1.56.2
71+
- hsluv==5.0.3
72+
- httplib2==0.22.0
73+
- idna==3.4
74+
- importlib-metadata==6.8.0
75+
- importlib-resources==6.0.0
76+
- ipython==8.12.2
77+
- ipywidgets==8.1.0
78+
- itsdangerous==2.1.2
79+
- jedi==0.19.0
80+
- jinja2==3.1.2
81+
- joblib==1.3.1
82+
- jsonschema==4.18.6
83+
- jsonschema-specifications==2023.7.1
84+
- jupyter-core==5.3.1
85+
- jupyterlab-widgets==3.0.8
86+
- kiwisolver==1.4.4
87+
- knn-nanoflann==0.0.0
88+
- lxml==4.9.3
89+
- markdown==3.4.4
90+
- markupsafe==2.1.3
91+
- matplotlib==3.7.2
92+
- matplotlib-inline==0.1.6
93+
- nbformat==5.7.0
94+
- nest-asyncio==1.5.7
95+
- networkx==3.1
96+
- nltk==3.8.1
97+
- numpy==1.24.4
98+
- oauth2client==4.1.3
99+
- oauthlib==3.2.2
100+
- open3d==0.17.0
101+
- packaging==23.1
102+
- pandas==2.0.3
103+
- parso==0.8.3
104+
- pexpect==4.8.0
105+
- pickleshare==0.7.5
106+
- pillow==10.0.0
107+
- pkgutil-resolve-name==1.3.10
108+
- platformdirs==3.10.0
109+
- plotly==5.15.0
110+
- plyfile==1.0.1
111+
- prompt-toolkit==3.0.39
112+
- protobuf==4.23.4
113+
- ptyprocess==0.7.0
114+
- pure-eval==0.2.2
115+
- pyasn1==0.5.0
116+
- pyasn1-modules==0.3.0
117+
- pydrive==1.3.1
118+
- pygments==2.15.1
119+
- pykdtree==1.3.7.post0
120+
- pyparsing==3.0.9
121+
- pyquaternion==0.9.9
122+
- pysocks==1.7.1
123+
- python-dateutil==2.8.2
124+
- pytz==2023.3
125+
- pyyaml==6.0.1
126+
- referencing==0.30.0
127+
- regex==2023.6.3
128+
- requests==2.31.0
129+
- requests-oauthlib==1.3.1
130+
- retrying==1.3.4
131+
- rpds-py==0.9.2
132+
- rsa==4.9
133+
- scikit-learn==1.3.0
134+
- scipy==1.10.1
135+
- six==1.16.0
136+
- sklearn==0.0.post7
137+
- soupsieve==2.4.1
138+
- stack-data==0.6.2
139+
- summary==0.2.0
140+
- tenacity==8.2.2
141+
- tensorboard==2.13.0
142+
- tensorboard-data-server==0.7.1
143+
- threadpoolctl==3.2.0
144+
- torch==1.13.1+cu117
145+
- torch-scatter==2.1.1+pt113cu117
146+
- torch-sparse==0.6.17+pt113cu117
147+
- torchaudio==0.13.1+cu117
148+
- torchsummary==1.5.1
149+
- torchvision==0.14.1+cu117
150+
- tqdm==4.65.0
151+
- traitlets==5.9.0
152+
- trimesh==3.22.5
153+
- typing-extensions==4.7.1
154+
- tzdata==2023.3
155+
- uritemplate==4.1.1
156+
- urllib3==1.26.16
157+
- vispy==0.13.0
158+
- wcwidth==0.2.6
159+
- werkzeug==2.2.3
160+
- widgetsnbextension==4.0.8
161+
- zipp==3.16.2
162+
prefix: /media/SSD0/xindeng/anaconda3/envs/rangeudf

0 commit comments

Comments
 (0)