(basedir, match_type, factors=None)
| 244 | |
| 245 | |
| 246 | def 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 |
no test coverage detected