lambdaloop / anipose

πŸœπŸ€πŸ’πŸšΆ A toolkit for robust markerless 3D pose estimation
http://anipose.org
BSD 2-Clause "Simplified" License
351 stars 66 forks source link

Error with Anipose Label-3d command #114

Closed rohanjoshii closed 10 months ago

rohanjoshii commented 11 months ago

Recently, the lab in which I volunteer has been attempting to use video feeds of mice to construct a 3D model of a mouse and a cricket. At present, we are just trying to produce a working model of the mouse and will tackle adding the multi-animal functionality in the future. We have labeled frames and trained our neural network to generate our necessary data through DeepLabCut with minimal error. We've been able to calibrate our cricket hunting arena by taping 4-5 min videos of ourselves showing the four cameras a checkerboard from many different angles and orientations. When running the anipose calibrate command, we observe that the # of boards decreases significantly with camera view; we have four cameras and during the last calibration, we detected 668, 289, 64, and 498 boards in our successive views. Is this normal? When generating out .csv files with anipose triangulate, we also get huge error values for the key points on our mice. Finally, when we run anipose label-3d, we run into a consistent indexing error which states:

some_vid = orig_fnames[basename][0]

IndexError: list index out of range.

From our estimate it seems as though anipose is having trouble accessing the videos onto which it's trying to superimpose our 3D points? Please anyone let me know if they have any insight on the matter. Here's the entire error message:

Triangulating points... C:\Users\ATarakji\Desktop\RohanStuff\anipose-tester\trial1\pose-3d\DLC_resnet50_3DTestingSep26shuffle1_490000_Raw.csv

(anipose) C:\Users\ATarakji\Desktop\RohanStuff\anipose-tester>anipose label-3d Labeling videos in 3D... C:\Users\ATarakji\Desktop\RohanStuff\anipose-tester\trial1\videos-3d\DLC_resnet50_3DTestingSep26shuffle1_490000_Raw.mp4 Traceback (most recent call last): File "C:\ProgramData\anaconda3\envs\anipose\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\ProgramData\anaconda3\envs\anipose\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\ProgramData\anaconda3\envs\anipose\Scripts\anipose.exe__main.py", line 7, in File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\click\core.py", line 1157, in call return self.main(*args, kwargs) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\click\core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\click\core.py", line 783, in invoke return callback(*args, kwargs) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\click\decorators.py", line 92, in new_func return ctx.invoke(f, obj, *args, *kwargs) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\click\core.py", line 783, in invoke return __callback(args, kwargs) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\anipose\anipose.py", line 259, in label_3d label_videos_3d_all(config) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\anipose\common.py", line 168, in fun return process_all(config, process_session, args) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\anipose\common.py", line 153, in process_all output[past_folders] = process_session(config, path, args) File "C:\ProgramData\anaconda3\envs\anipose\lib\site-packages\anipose\label_videos_3d.py", line 194, in process_session some_vid = orig_fnames[basename][0] IndexError: list index out of range

rohanjoshii commented 11 months ago

configtoshare.txt

Here's our config file for reference

RiSpa5 commented 11 months ago

I am currently having the same problem! Did you happen to find a solution?

smarkoco commented 11 months ago

Also having this issue, and difficult to troubleshoot because of the way it's installed with pip. Not sure how to run it with the debugger in python because of this

smarkoco commented 11 months ago

Update on this. Okay, I think it has to do with a mismatch of video files that exist in other folders because I was trying to run label-3d on a subset of the videos I had inside pose-2d. Once I removed all extra videos from all other folders, and deleted any of the other Anipose folders except pose-2d and videos-raw, I reran triangulate and then reran label-3d and it worked! :tada:

RiSpa5 commented 11 months ago

Update: I happened to solve this issue too. I believe that for me the problem was a mismatch between the pose-3d .csv file name and the name of the files in video-raw and pose-2d, which I think was due to the unproper use of the "cam_regex" parameter in the config file. Once I changed the cam_regex parameter, deleted the unnecessary folders, and rerun everything it worked! Thanks to @smarkoco for the precious hint!

lambdaloop commented 10 months ago

Thank you @smarkoco and @RiSpa5 for providing an update for resolving the issue. I'll close the issue then. @rohanjoshii if the issue is not resolved, please feel free to reopen.