Visitar URL original
RTMpose_x superanimal_humanbody by MMathisLab · Pull Request #3043 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
062e07e
edge case fix
MMathisLab Jul 1, 2025
be335f3
fix
MMathisLab Jul 1, 2025
8698d86
best
MMathisLab Jul 1, 2025
240584b
rc10
MMathisLab Jul 1, 2025
83f34b8
humanbody model zoo
MMathisLab Jul 5, 2025
165ff4c
Merge branch 'main' into mwm/humanbody
MMathisLab Jul 5, 2025
277fb22
Update video_inference.py
MMathisLab Jul 5, 2025
1fecece
onwards
MMathisLab Jul 5, 2025
618483a
working
MMathisLab Jul 5, 2025
8e46f4e
simpler
MMathisLab Jul 5, 2025
3e6ec52
working
MMathisLab Jul 5, 2025
7fab6fc
import depth
MMathisLab Jul 5, 2025
dbd0fd4
better warning message
MMathisLab Jul 5, 2025
ed4f786
less brittle check for torchvision model
MMathisLab Jul 5, 2025
65d00f1
all files
MMathisLab Jul 5, 2025
501f142
video fix
MMathisLab Jul 5, 2025
6b464b3
adapt other API
MMathisLab Jul 5, 2025
7600167
fix
MMathisLab Jul 5, 2025
8ce206b
cleaning up my mistakes
MMathisLab Jul 5, 2025
3515ba5
superanimals working
MMathisLab Jul 5, 2025
63929e8
likely fix for failing test
MMathisLab Jul 5, 2025
9286699
Fix hard-coded identity_scores dimensions in identity accuracy tests …
Copilot Jul 5, 2025
2dbeea6
Fix visualization reshape error with descriptive error messages and v…
Copilot Jul 5, 2025
dda7254
revert to main behavior in # of indv
MMathisLab Jul 6, 2025
74f420f
fix utils for logic
MMathisLab Jul 6, 2025
aff5703
remove my local test file
MMathisLab Jul 6, 2025
59a46cb
Update fasterRCNN.py
MMathisLab Jul 6, 2025
bd32b30
cleaning
MMathisLab Jul 6, 2025
cb3ec0c
testing
MMathisLab Jul 6, 2025
3536746
Update superanimal_inference.py
MMathisLab Jul 6, 2025
91d43c1
longer test back to main status
MMathisLab Jul 6, 2025
fee2e2f
Leave comment in unittests on what should be done
AlexEMG Jul 6, 2025
02cbf93
Update TF docstring
AlexEMG Jul 6, 2025
9a9b2f8
small fix for 2x run for pose
MMathisLab Jul 6, 2025
686bd4a
Update version to rc11
AlexEMG Jul 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adapt other API
  • Loading branch information
MMathisLab committed Jul 5, 2025
commit 6b464b33fa275d9af41ac253f8a6d3877fe05bf6
56 changes: 48 additions & 8 deletions deeplabcut/modelzoo/video_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,50 @@ def video_inference_superanimal(
"You have to specify a detector_name when using the Pytorch framework."
)

# Special handling for superanimal_humanbody - use dedicated implementation
if superanimal_name == "superanimal_humanbody":
from deeplabcut.pose_estimation_pytorch.modelzoo.superanimal_humanbody_video_inference import (
analyze_videos_superanimal_humanbody,
)

# Convert videos to list if needed
if isinstance(videos, str):
videos = [videos]

# Set destination folder
if dest_folder is None:
dest_folder = Path(videos[0]).parent
else:
dest_folder = Path(dest_folder)

if not dest_folder.exists():
dest_folder.mkdir(parents=True, exist_ok=True)

# Map parameters to the dedicated function
# Note: analyze_videos_superanimal_humanbody has its own parameter set
dedicated_kwargs = {
"videotype": videotype,
"destfolder": str(dest_folder),
"bbox_threshold": bbox_threshold,
"pose_threshold": pcutoff,
"device": device,
"cropping": cropping,
"batch_size": batch_size,
"detector_batch_size": detector_batch_size,
}

# Use a dummy config path since the dedicated function loads its own config
dummy_config = "superanimal_humanbody"

results = analyze_videos_superanimal_humanbody(
dummy_config,
videos,
**dedicated_kwargs,
)

return results

# Standard PyTorch implementation for other models
from deeplabcut.pose_estimation_pytorch.modelzoo.inference import (
_video_inference_superanimal,
)
Expand All @@ -371,14 +415,10 @@ def video_inference_superanimal(

detector_path = customized_detector_checkpoint
if detector_path is None:
# For superanimal_humanbody, use torchvision detectors (no downloaded detector)
if superanimal_name == "superanimal_humanbody":
detector_path = None
else:
detector_path = get_super_animal_snapshot_path(
dataset=superanimal_name,
model_name=detector_name,
)
detector_path = get_super_animal_snapshot_path(
dataset=superanimal_name,
model_name=detector_name,
)

dlc_scorer = get_super_animal_scorer(
superanimal_name, pose_model_path, detector_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def __init__(
else:
weights = None

# PATCH: Do not pass num_classes when using pretrained weights (Colab logic)
if weights is not None:
self.model = model_fn(
weights=weights,
Expand All @@ -100,7 +99,7 @@ def __init__(
**model_kwargs,
)

# Use only weights.transforms() for preprocessing (Colab logic)
self.transforms = weights.transforms() if weights is not None else None
self.transforms = weights.transforms() if weights is not None else None

self.model.eager_outputs = lambda losses, detections: (losses, detections)
Expand Down