lambdaloop / anipose

🐜🐀🐒🚶 A toolkit for robust markerless 3D pose estimation
http://anipose.org
BSD 2-Clause "Simplified" License
351 stars 66 forks source link

draw-calibration / anipose analyze not working #49

Open Coco1234Coco opened 4 years ago

Coco1234Coco commented 4 years ago

Hi folks,

this is kind of a follow up of issue #46. After solving the issue of 0 detected calibration patterns / checkerboards, I encountered two more issues:

  1. draw-calibration ending with an error (see output 1 below)
  2. anipose analyze running for 1-2s before stopping without error and/or output (see output 2 below)

Output 1 / draw-calibration

(anipose-conrad) C:\Conrad\AniPose\rect_check--unfilled>anipose draw-calibration
Drawing calibration board...
Traceback (most recent call last):
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\bknUser\anaconda3\envs\anipose-conrad\Scripts\anipose.exe\__main__.py", line 7, in <module>
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\site-packages\click\decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\bknuser\anaconda3\envs\anipose-conrad\lib\site-packages\anipose\anipose.py", line 287, in draw_calibration
    cv2.imwrite('calibration.png', img)
cv2.error: OpenCV(3.4.11) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-lw30ardm\opencv\modules\imgcodecs\src\loadsave.cpp:759: error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite'

Output 2 - anipose analyze

(anipose-conrad) C:\Conrad\AniPose\rect_check--unfilled>anipose analyze
Analyzing videos...

(anipose-conrad) C:\Conrad\AniPose\rect_check--unfilled>

A few infos of my setup: OS: Win10 Pro, 1903, System Build: 18362.1082 CPU: Core i7-9750H GPU: RTX 2070 Max-Q GPU driver: 442.23 DCH

Installed python libraries and versions: see conda list output.txt conda list output.txt

For an overview of the anipose projects folder and file structure: see tree output anipose dir.txt tree output anipose dir.txt

For the DLC and anipose config files see config_files.zip config_files.zip

You'll also find the calibration toml and pickle attached: calibration.zip

I really want to use anipose for cheap in the field human reach motion tracking but don't really know what else to do. Any hint as to where the problem could originate is much appreciated.

Cheers, Conrad

Coco1234Coco commented 4 years ago

Update: It seems that anipose is now analyzing the videos. All I did was add one subfolder where videos_raw, calibration and pose_2d are nested in, set nesting to 1 (the former two steps didn't solve the problem; I just mentioned them to give a detailed account) and added

[pipeline]
videos_raw = "videos_raw"

The latter struck me as kind of odd. I thought I just needed to add the [pipeline] options when deviating from the default naming scheme.

But anipose doesn't seem to utilize the GPU which is used by DLC without any problems.

lambdaloop commented 3 years ago

For the draw-calibration issue, we haven't yet made a drawing function for the checkerboard... I recommend getting a drawing from https://calib.io/pages/camera-calibration-pattern-generator

For the the second one, the default naming scheme for the files are all with "-" ("videos-raw"). You can see all the defaults here: https://github.com/lambdaloop/anipose/blob/master/anipose/anipose.py That's why it was not working with "videos_raw".

Let me know if that makes sense or if you have any other issues.