cvg / pixel-perfect-sfm

Pixel-Perfect Structure-from-Motion with Featuremetric Refinement (ICCV 2021, Best Student Paper Award)
Apache License 2.0
1.29k stars 132 forks source link

Type Error with reconstruction object #105

Open bdxuyidong opened 1 year ago

bdxuyidong commented 1 year ago

Hi. Thanks for your work. I met some problems running the Demo at: refined, sfm_outputs = sfm.reconstruction(ref_dir, images, sfm_pairs, features, matches, image_list=references) The output is: File /pixel-perfect-sfm/pixsfm/bundle_adjustment/main.py:133, in FeatureReferenceBundleAdjuster.refine(self, reconstruction, feature_set, problem_setup) 131 print(reconstruction) 132 # --> 133 feature_view = features.FeatureView( 134 feature_set, 135 reconstruction 136 ) 138 # Schedule reference computation (label for each point3D) 139 problem_labels = find_problem_labels(reconstruction, 140 self.conf.max_tracks_per_problem)

TypeError: FeatureView(): incompatible function arguments. The following argument types are supported:

  1. (feature_set: pixsfm._pixsfm._features.FeatureSet_f16, reconstruction: colmap::Reconstruction) -> pixsfm._pixsfm._features.FeatureView_f16
  2. (feature_set: pixsfm._pixsfm._features.FeatureSet_f16, graph: pixsfm._pixsfm._base.Graph) -> pixsfm._pixsfm._features.FeatureView_f16
  3. (feature_set: pixsfm._pixsfm._features.FeatureSet_f16, graph: pixsfm._pixsfm._base.Graph, required_nodes: Set[int]) -> pixsfm._pixsfm._features.FeatureView_f16
  4. (feature_set: pixsfm._pixsfm._features.FeatureSet_f16, image_names: Set[str]) -> pixsfm._pixsfm._features.FeatureView_f16
  5. (feature_set: pixsfm._pixsfm._features.FeatureSet_f16, reconstruction: colmap::Reconstruction, point3D_ids: Set[int]) -> pixsfm._pixsfm._features.FeatureView_f16
  6. (feature_set: pixsfm._pixsfm._features.FeatureSet_f64, reconstruction: colmap::Reconstruction) -> pixsfm._pixsfm._features.FeatureView_f64
  7. (feature_set: pixsfm._pixsfm._features.FeatureSet_f64, graph: pixsfm._pixsfm._base.Graph) -> pixsfm._pixsfm._features.FeatureView_f64
  8. (feature_set: pixsfm._pixsfm._features.FeatureSet_f64, graph: pixsfm._pixsfm._base.Graph, required_nodes: Set[int]) -> pixsfm._pixsfm._features.FeatureView_f64
  9. (feature_set: pixsfm._pixsfm._features.FeatureSet_f64, image_names: Set[str]) -> pixsfm._pixsfm._features.FeatureView_f64
  10. (feature_set: pixsfm._pixsfm._features.FeatureSet_f64, reconstruction: colmap::Reconstruction, point3D_ids: Set[int]) -> pixsfm._pixsfm._features.FeatureView_f64
  11. (feature_set: pixsfm._pixsfm._features.FeatureSet_f32, reconstruction: colmap::Reconstruction) -> pixsfm._pixsfm._features.FeatureView_f32
  12. (feature_set: pixsfm._pixsfm._features.FeatureSet_f32, graph: pixsfm._pixsfm._base.Graph) -> pixsfm._pixsfm._features.FeatureView_f32
  13. (feature_set: pixsfm._pixsfm._features.FeatureSet_f32, graph: pixsfm._pixsfm._base.Graph, required_nodes: Set[int]) -> pixsfm._pixsfm._features.FeatureView_f32
  14. (feature_set: pixsfm._pixsfm._features.FeatureSet_f32, image_names: Set[str]) -> pixsfm._pixsfm._features.FeatureView_f32
  15. (feature_set: pixsfm._pixsfm._features.FeatureSet_f32, reconstruction: colmap::Reconstruction, point3D_ids: Set[int]) -> pixsfm._pixsfm._features.FeatureView_f32

Invoked with: ,

It seems that the object 'reconstruction' is the wrong type before enter into features.FeatureView(), I also output feature_set and reconstruction, they are: <pixsfm._pixsfm._features.FeatureSet_f16 object at 0x7f876e078870> <Reconstruction 'num_reg_images=10, num_cameras=10, num_points3D=1852, num_observations=8071'>

By the way, I can run the raw reconstruction without refinement. Please help me with the problem, thank you.

Phil26AT commented 1 year ago

Hi again :) This seems to be a linking error between pycolmap and pixsfm. Did you check that also pycolmap is installed from source?

awarebayes commented 10 months ago

Got it also