bytedance / particle-sfm

ParticleSfM: Exploiting Dense Point Trajectories for Localizing Moving Cameras in the Wild. ECCV 2022.
http://b1ueber2y.me/projects/ParticleSfM/
GNU General Public License v3.0
279 stars 23 forks source link

ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 0 is different from 3) #28

Open Lifedecoder opened 3 months ago

Lifedecoder commented 3 months ago

Hi! When I run run_particlesfm.py on 16 256x256 images, the error goes up:

Elapsed time: 0.376 [minutes] {'num_reg_images': 16, 'num_sparse_points': 1141, 'num_observations': 10630, 'mean_track_length': 9.316389, 'num_observations_per_image': 664.375, 'mean_reproj_error': 0.401069} WARNING:root:This SfM file structure was deprecated in hloc v1.1 88%|███████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 14/16 [00:00<00:00, 62.94it/s] Traceback (most recent call last): File "run_particlesfm.py", line 159, in particlesfm(args, args.image_dir, args.output_dir, skip_exists=args.skip_exists, keep_intermediate=args.keep_intermediate) File "run_particlesfm.py", line 114, in particlesfm sfm_reconstruction(args, image_dir, output_dir, traj_dir, skip_exists=skip_exists, keep_intermediate=keep_intermediate) File "run_particlesfm.py", line 88, in sfm_reconstruction write_depth_pose_from_colmap_format(sfm_dir, os.path.join(output_dir, "colmap_outputs_converted")) File "/data2/yuxq/SFM/particle-sfm/sfm/convert.py", line 102, in write_depth_pose_from_colmap_format save_depth_pose(output_dir, cameras, images, points3D) File "/data2/yuxq/SFM/particle-sfm/sfm/convert.py", line 84, in save_depth_pose cam_points = np.matmul(R, points_3d) + t ValueError: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 0 is different from 3)

But when I ran on 16 1024x1024 images, it doesn't have such problems. I wonder why this could happen and how to solve it. Thanks!

Lifedecoder commented 3 months ago

It seems that no 3d point in last few frames, could it be the camera motion too drastic so no points are matched?