Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_slam.py error for the video with fixed camera #7

Closed
ericwang0701 opened this issue Mar 15, 2023 · 2 comments
Closed

run_slam.py error for the video with fixed camera #7

ericwang0701 opened this issue Mar 15, 2023 · 2 comments

Comments

@ericwang0701
Copy link

Hi,

As I mentioned in another #2 issue, I ran into the following error when I tried to use my own custom video.
File "/home/eric-gtxrar/documents/slahmr/third-party/DROID-SLAM/droid_slam/factor_graph.py", line 374, in add_proximity_factors ii, jj = torch.as_tensor(es, device=self.device).unbind(dim=-1) ValueError: not enough values to unpack (expected 2, got 0)

After looking into the code and testing with different videos, I realized that if the camera is fully fixed (e.g. mounted on a tripod) in the video, it will have the above error. But the camera is not fixed, I can successfully generate the result below. Any suggestion to make it work for videos with a fixed camera would be appreciated. Thanks!

image

@ericwang0701
Copy link
Author

I just found a temporary solution to this issue. In the DROID-SLAM, the motion_filter.py filters incoming frames so that there is enough motion. If the camera is fixed, the computed value will be below the current default value of 2.5 and not be added in the later processing. So what I did is lower the threshold value to 0.1 and it works for video with the fixed camera now.

@vye16
Copy link
Owner

vye16 commented Mar 22, 2023

Hi, thank you for bringing this up, changing the filter_thresh argument in run_slam.py is a great fix. I also updated the script to handle this case in which there is only one keyframe in the SLAM map in commit a75251f

@vye16 vye16 closed this as completed Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants