MCPcopy
hub / github.com/Totoro97/NeuS / gen_poses

Function gen_poses

preprocess_custom_data/colmap_preprocess/pose_utils.py:246–272  ·  view source on GitHub ↗
(basedir, match_type, factors=None)

Source from the content-addressed store, hash-verified

244
245
246def gen_poses(basedir, match_type, factors=None):
247
248 files_needed = ['{}.bin'.format(f) for f in ['cameras', 'images', 'points3D']]
249 if os.path.exists(os.path.join(basedir, 'sparse/0')):
250 files_had = os.listdir(os.path.join(basedir, 'sparse/0'))
251 else:
252 files_had = []
253 if not all([f in files_had for f in files_needed]):
254 print( 'Need to run COLMAP' )
255 run_colmap(basedir, match_type)
256 else:
257 print('Don\'t need to run COLMAP')
258
259 print('Post-colmap')
260
261 poses, pts3d, perm = load_colmap_data(basedir)
262
263
264 save_poses(basedir, poses, pts3d, perm)
265
266 if factors is not None:
267 print( 'Factors:', factors)
268 minify(basedir, factors)
269
270 print( 'Done with imgs2poses' )
271
272 return True
273

Callers 1

imgs2poses.pyFile · 0.90

Calls 4

run_colmapFunction · 0.90
load_colmap_dataFunction · 0.85
save_posesFunction · 0.85
minifyFunction · 0.85

Tested by

no test coverage detected