Adding cropping to pose_estimation_pytorch/apis/analyze_videos.py#2737
Conversation
|
I can't add the reviewers @AlexEMG |
n-poulsen
left a comment
There was a problem hiding this comment.
@YankoFelipe this is awesome, thank you for implementing the cropping feature!
There are a few changes that I think should be made to match the tensorflow implementation of cropping.
As is done in the tensorflow implementation, I would read the cropping parameters from the project configuration file if no cropping parameters were passed (e.g., in analyze_videos, after the if batch_size is None: batch_size = cfg.get("batch_size", 1) lines ):
if cropping is None and cfg.get("cropping", False):
cropping = cfg["x1"], cfg["x2"], cfg["y1"], cfg["y2"]When calling metadata = _generate_metadata(, I would also pass the cropping parameters that were used (this can be done through a VideoIterator object instead of passing a VideoReader) so they can be stored in the video analysis metadata file.
|
Hi DeepLabCut! I am using Deeplabcut 3.0.0rc4 on windows11. Deeplabcut failed to crop the video when analyze new videos using the parameters in config file. I tried via GUI and command, but both of them didn't work. Will there be a new release to fix this issue? Thank you!! |
|
hey @Jiachen24 - yes, a new release will be made with the fixes from this branch :) |
n-poulsen
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks @YankoFelipe!
Hello DeepLabCut!
I'm integrating DLC-Pytorch into my project (2D/single animal) and I needed to add cropping functionality to
deeplabcut.analyze_videos. Unfortunately I wasn't able to run the test scripts due different errors so I'd appreciate if someone from the team can run them, the log files of my runs are below. I tested the output ofdeeplabcut.analyze_videoswith my data and it looked good so far.testscript.py: https://datashare.mpcdf.mpg.de/s/UXTZAoKIejb0iKx
testscript_pytorch_multi_animal.py: https://datashare.mpcdf.mpg.de/s/AZsJ18QsA74CeRG
testscript_pytorch_single_animal.py: https://datashare.mpcdf.mpg.de/s/OrIwKmmMmkCwRho
The change is mostly moving VideoWriter.set_bbox to the parent class and pass cropping to VideoIterator. Everything was performed in 24ba111 aka. 3.0.0rc4 on SUSE Linux 15.5.
Best,
Yanko