You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is impossible to retrieve movie timestamps due to dlc2nwb.utils.get_movietimestamps throwing TypeError: object of type 'cv2.VideoCapture' has no len()
This error might depend on the opencv-python version, in which case pinning the DLC2NWB package to whichever version added the ability to get the len() of a cv.VideoReader (or the one before they took it away if it's an old feature) is the simplest solution.
Alternatively, the first return value of reader.read() is a boolean indicating whether a frame was successfully reader, so using this to change the for loop to a while loop, like so:
fixes the issue. However, (again, possibly depending on your opencv-python version) you then run into an AttributeError on line 83, since a cv2.VideoReader has no attribute fps. This can be fixed by replacing reader.fps on that line with reader.get(cv2.CAP_PROP_FPS)
The text was updated successfully, but these errors were encountered:
It is impossible to retrieve movie timestamps due to
dlc2nwb.utils.get_movietimestamps
throwingTypeError: object of type 'cv2.VideoCapture' has no len()
Steps to reproduce:
Expected behaviour:
The timestamps are returned
Actual behaviour:
TypeError: object of type 'cv2.VideoCapture' has no len()
Environment info:
OS: Windows 10 x64
Conda version: 23.3.1
Python version: 3.9.0
opencv-python version: 4.7.0.72
dlc2nwb version: 0.3
Additional info:
This error might depend on the opencv-python version, in which case pinning the DLC2NWB package to whichever version added the ability to get the
len()
of acv.VideoReader
(or the one before they took it away if it's an old feature) is the simplest solution.Alternatively, the first return value of reader.read() is a boolean indicating whether a frame was successfully reader, so using this to change the
for
loop to awhile
loop, like so:fixes the issue. However, (again, possibly depending on your opencv-python version) you then run into an
AttributeError
on line 83, since acv2.VideoReader
has no attributefps
. This can be fixed by replacingreader.fps
on that line withreader.get(cv2.CAP_PROP_FPS)
The text was updated successfully, but these errors were encountered: