Closed jeongjunjjkim closed 7 months ago
I believe this is intentional but maybe @h-mayorquin can confirm
I recall a lot of work being done regarding how DLC interacts with OpenCV and how timestamps come into that: https://github.com/DeepLabCut/DLC2NWB/pull/16
@jeongjunjjkim Can you show your traceback? Is your video file available?
If your video file is available then dlct2nwb
will extract the timestamps from there. If not, then it will just use the frames as timestamps:
I think this is what you are seeing.
@CodyCBakerPhD
About the following I am less confident but from memory the context of the situation is the following:
The problem with this -and happens in sleap as well- is that the PoseEstimationSeries
do not have a uniform sampling rate. The reason being, that a specific node (say an arm) might not get a sucesfully prediction of position at any given frame so that is skipped. This means that they are not uniform so it is wrong to write sampling rate.
On the other hand, the video is usually available at analysis time (when people make the prediciton of positions) but not at conversion time. So the timestamps are usually not availalable.
The best solution would be for the formats to keep this information in their provenance files but this is not yet done and I am not sure that's a prioirty.
Meanwhile, when I did sleap I left a way of passing general metadata to the nwbfile:
But when this was done for dlc2nwb
we were not so timestamp savy so nobody though about that. Probably this will be the way to go to add full time awareness to DeepLabCutInterface
(which should not be inherting from BaseTemporalAlignmentInterface
yet!)
@h-mayorquin Ah that makes sense - I just used the h5 file without the video file. On a related note, more about feature, rather than bug, it would be nice to have a method to set timestamps (arbitrarily). Often folks have continuous ephys recordings but discontinuous, trial-based video recordings. I see this is implemented in VideoInterface but not DLC Interface.
Can you show your traceback? Is your video file available?
I don't think it's causing an error, it sounds like it writes to the file it's just the value of the contents is incorrect (or rather, the units of the timestamps is incorrect, perhaps it should be 'samples')
@CodyCBakerPhD There should be a warning that indicates that the video file is not available as expected but he already confirmed. that.
@jeongjunjjkim Yes, that's our goal. Most of our interfaces support setting timestamps but is hidden under alignment: https://neuroconv.readthedocs.io/en/main/user_guide/temporal_alignment.html The other comment addressed to @CodyCBakerPhD was meant to delineate how can add suppport for these time setters on this specific interface.
OK, So we provided and explanation and now DeepLabCutInterface
has the the set_aligned_timestamps
method:
I will close this issue as solved
What happened?
Converting DeepLabCut h5 files into nwb generates timestamps based on frames rather than frame rate. e.g. 8000 frames, 400Hz tracked video leads to timestamps of 1-8000 s on ndx-pose rather than 1-20s.
Steps to Reproduce
Traceback
No response
Operating System
Windows
Python Executable
Conda
Python Version
3.9
Package Versions
No response
Code of Conduct