>> python scripts/preprocessing/extract_mesh_depth.py --vid=P06_01 --root=<my_storage_root_redacted_for_privacy>
Processing P06_01 ...
Saving files ...
0%| | 0/298 [00:00<?, ?it/s]
========== My debugging start ==========
pycolmap.__version__='3.11.1'
Attributes of pycolmap using dir(pycolmap):
['', 'AbsolutePoseEstimationOptions', 'AbsolutePoseRefinementOptions', 'BACovariance', 'BACovarianceOptions', 'BACovarianceOptionsParams', 'BundleAdjuster', 'BundleAdjustmentConfig', 'BundleAdjustmentOptions', 'COLMAP_build', 'COLMAP_version', 'Camera', 'CameraMode', 'CameraModelId', 'CopyType', 'Correspondence', 'CorrespondenceGraph', 'Database', 'DatabaseCache', 'DatabaseTransaction', 'DelaunayMeshingOptions', 'Device', 'EstimateTriangulationOptions', 'ExhaustiveMatchingOptions', 'ExhaustivePairGenerator', 'ExperimentalPoseParam', 'Image', 'ImageAlignmentError', 'ImagePairStat', 'ImagePairsMatchingOptions', 'ImageReaderOptions', 'ImageSelectionMethod', 'ImportedPairGenerator', 'IncrementalMapper', 'IncrementalMapperCallback', 'IncrementalMapperOptions', 'IncrementalMapperStatus', 'IncrementalPipeline', 'IncrementalPipelineOptions', 'IncrementalTriangulator', 'IncrementalTriangulatorOptions', 'ItemsView', 'KeysView', 'ListPoint2D', 'LocalBundleAdjustmentReport', 'LossFunctionType', 'MapCameraIdToCamera', 'MapImageIdToImage', 'MapPoint3DIdToPoint3D', 'Normalization', 'ObservationManager', 'PairGenerator', 'Point2D', 'Point3D', 'PoissonMeshingOptions', 'PosePrior', 'PosePriorBundleAdjustmentOptions', 'PosePriorCoordinateSystem', 'RANSACOptions', 'Reconstruction', 'ReconstructionManager', 'Rigid3d', 'Rotation3d', 'SequentialMatchingOptions', 'SequentialPairGenerator', 'Sift', 'SiftExtractionOptions', 'SiftMatchingOptions', 'Sim3d', 'SpatialMatchingOptions', 'SpatialPairGenerator', 'StereoFusionOptions', 'SyntheticDatasetMatchConfig', 'SyntheticDatasetOptions', 'TYPE_CHECKING', 'Timer', 'Track', 'TrackElement', 'TriangulationResidualType', 'TwoViewGeometry', 'TwoViewGeometryConfiguration', 'TwoViewGeometryOptions', 'UndistortCameraOptions', 'ValuesView', 'VocabTreeMatchingOptions', 'VocabTreePairGenerator', '__all__', '__builtins__', '__cached__', '__ceres_version__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_core', 'align_reconstruction_to_locations', 'align_reconstructions_via_points', 'align_reconstructions_via_proj_centers', 'align_reconstructions_via_reprojections', 'bundle_adjustment', 'compare_reconstructions', 'compute_squared_sampson_error', 'create_default_bundle_adjuster', 'create_pose_prior_bundle_adjuster', 'essential_matrix_from_pose', 'estimate_absolute_pose', 'estimate_and_refine_absolute_pose', 'estimate_and_refine_generalized_absolute_pose', 'estimate_ba_covariance', 'estimate_calibrated_two_view_geometry', 'estimate_essential_matrix', 'estimate_fundamental_matrix', 'estimate_homography_matrix', 'estimate_sim3d', 'estimate_sim3d_robust', 'estimate_triangulation', 'estimate_two_view_geometry', 'estimate_two_view_geometry_pose', 'extract_features', 'has_cuda', 'import_images', 'import_module_symbols', 'incremental_mapping', 'infer_camera_from_image', 'logging', 'match_exhaustive', 'match_sequential', 'match_spatial', 'match_vocabtree', 'ostream', 'poisson_meshing', 'pose_from_homography_matrix', 'pyceres', 'refine_absolute_pose', 'set_random_seed', 'stereo_fusion', 'synthesize_dataset', 'textwrap', 'triangulate_points', 'undistort_images', 'utils', 'verify_matches']
images[idx]:
Image(image_id=1, camera=Camera(camera_id=1), name="frame_0000000001.jpg", has_pose=1, triangulated=161/512)
Attributes of images[idx] using dir(images[idx]):
['__class__', '__copy__', '__deepcopy__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '_pybind11_conduit_v1_', 'cam_from_world', 'camera', 'camera_id', 'get_observation_point2D_idxs', 'get_observation_points2D', 'has_camera_id', 'has_camera_ptr', 'has_point3D', 'has_pose', 'image_id', 'mergedict', 'name', 'num_points2D', 'num_points3D', 'point2D', 'points2D', 'project_point', 'projection_center', 'reset_camera_ptr', 'reset_point3D_for_point2D', 'reset_pose', 'set_point3D_for_point2D', 'summary', 'todict', 'viewing_direction']
========== My debugging end ==========
0%| | 0/298 [00:00<?, ?it/s]
Traceback (most recent call last):
File "~/egoseg3d/scripts/preprocessing/extract_mesh_depth.py", line 80, in <module>
run(args)
File "~/egoseg3d/scripts/preprocessing/extract_mesh_depth.py", line 70, in run
mesh_depth = align_depth.rasterize_mesh_with_pyrender(
File "~/egoseg3d/scripts/preprocessing/align_depth.py", line 92, in rasterize_mesh_with_pyrender
R = np.asmatrix(pycolmap.qvec_to_rotmat(images[idx].qvec)).transpose()
AttributeError: module 'pycolmap' has no attribute 'qvec_to_rotmat'
Description
When running
scripts/preprocessing/extract_mesh_depth.pyusing the provided command in theREADME.md, I encountered the following errorSteps to reproduce
What I expected
Installing
pycolmap==3.11.1(as listed inrequirements.txt) should provide the functions/attributes used in the repository scripts.What happened
pycolmap.qvec_to_rotmat()does not exist inpycolmap==3.11.1nor in the latest release.images[idx].qvecassumes aqvecattribute exists onpycolmap.Image, which it does not (verified viadir(images[idx])).Debugging details
I traced the error back to the function
rasterize_mesh_with_pyrender()insidescripts/preprocessing/align_depth.py. The line with the issue is:pycolmapversion withpycolmap.__version__pycolmapto confirmqvec_to_rotmat()indeed is not present usingdir(pycolmap)images[idx]to show thatqvecalso is not present usingdir(images[idx])Full error message