Visitar URL original
Fix CTD empty conditions edge case by maximpavliv · Pull Request #3076 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
eacbdaf
get_conditions_provider_for_video: load assemblies instead of full pi…
maximpavliv Jun 25, 2025
66f1da8
Fix CondProvider.load_conditions_pickle()
maximpavliv Jun 26, 2025
b5f341b
Fix FilterLowConfidencePoses
maximpavliv Jun 26, 2025
df805ec
Fix create_video_with_all_detections (bboxes generated by CTD inference)
maximpavliv Jun 26, 2025
8282f4d
PadOutputs: normalize output format
maximpavliv Jul 1, 2025
a098c63
Add CTD model to integration tests
maximpavliv Jun 25, 2025
2bd069f
Merge branch 'main' into maxim/add_ctd_integration_test
maximpavliv Jul 10, 2025
9f04c61
Formatting
maximpavliv Jul 11, 2025
2abf37c
Trim superanimal_humanbody.yaml default project config
maximpavliv Jul 21, 2025
a1a6be1
Trim superanimal_humanbody_colors
maximpavliv Jul 21, 2025
dfbce1d
Correct get_checkpoint_epoch
maximpavliv Jul 21, 2025
1432a73
Add rtmpose_x modelzoo model config
maximpavliv Jul 21, 2025
a4d74cc
Add FilteredDetector
maximpavliv Jul 21, 2025
0cbfe59
Add get_filtered_coco_detector_inference_runner() method
maximpavliv Jul 21, 2025
84b230e
Add ScaleToUnitRange transform
maximpavliv Jul 21, 2025
c4c1318
Superanimal humanbody inference: use filtered detector runner
maximpavliv Jul 21, 2025
dc511cd
ModelZoo tab: make humanbody general case
maximpavliv Jul 21, 2025
479cc66
get_super_animal_scorer(): add torchvision_detector_name arg
maximpavliv Jul 21, 2025
6a14584
Remove superanimal_humanbody_video_inference.py module
maximpavliv Jul 21, 2025
6774812
Regularize get_super_animal_model_config_path()
maximpavliv Jul 21, 2025
424ac92
Regularize load_super_animal_config()
maximpavliv Jul 21, 2025
04438f8
Regularize download_super_animal_snapshot()
maximpavliv Jul 21, 2025
256977b
update_config(): superanimal_humanbody - compatible
maximpavliv Jul 21, 2025
8d4cf20
Revert video_inference()
maximpavliv Jul 21, 2025
edf4f9d
Revert create_df_from_prediction()
maximpavliv Jul 21, 2025
cded581
Restore CTDInferenceRunner
maximpavliv Jul 21, 2025
7eaf923
Remove TorchvisionDetectorInferenceRunner
maximpavliv Jul 21, 2025
feb34d1
Revert DetectorInferenceRunner
maximpavliv Jul 21, 2025
711a47e
superanimal_analyze_images() - make humanbody compatible
maximpavliv Jul 21, 2025
28e4dd0
Revert build_predictions_dataframe()
maximpavliv Jul 21, 2025
193f935
Revert get_inference_runners()
maximpavliv Jul 21, 2025
613b2ac
Revert detectors/fasterRCNN.py
maximpavliv Jul 21, 2025
d848741
Revert detectors/torchvision.py
maximpavliv Jul 21, 2025
bba8689
Revert base Runner
maximpavliv Jul 21, 2025
25fa08d
Fix superanimal_humanbody unit test
maximpavliv Jul 31, 2025
425484b
Disable video adaptation for superanimal_humanbody
maximpavliv Jul 31, 2025
4b04013
Fix testscript_superanimal_inference.py
maximpavliv Jul 31, 2025
eea470e
Remove debug print
maximpavliv Jul 31, 2025
3d47a36
Black formatting
maximpavliv Jul 31, 2025
7b50466
Merge branch 'maxim/superanimal_humanbody_filtered_detector' into max…
maximpavliv Jul 31, 2025
0da592b
Black formatting
maximpavliv Jul 31, 2025
6c0dc12
FilterLowConfidencePoses: fix default aggregate_func
maximpavliv Aug 18, 2025
54b3b97
ConditionalKeypointsToModelInputs - empty cond kpts case
maximpavliv Aug 19, 2025
dbbd7d1
TopDownCrop: crop to required size even with empty bboxes list
maximpavliv Aug 19, 2025
62dda47
CTDInferenceRunner: shortcut predict() when empty conditions
maximpavliv Aug 19, 2025
e5ed8ee
Merge branch 'main' into maxim/cond_kpts_bug
maximpavliv Sep 4, 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
Regularize load_super_animal_config()
  • Loading branch information
maximpavliv committed Jul 21, 2025
commit 424ac92941fbdf30ff61c432a2b6575fc3836ca6
50 changes: 8 additions & 42 deletions deeplabcut/pose_estimation_pytorch/modelzoo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import torch
from dlclibrary import download_huggingface_model
import huggingface_hub

import deeplabcut.pose_estimation_pytorch.config.utils as config_utils
from deeplabcut.core.config import read_config_as_dict
Expand Down Expand Up @@ -108,52 +107,19 @@ def load_super_animal_config(
project_cfg_path = get_super_animal_project_config_path(super_animal=super_animal)
project_config = read_config_as_dict(project_cfg_path)

# Special handling for superanimal_humanbody with rtmpose_x - download config from HuggingFace
if super_animal == "superanimal_humanbody" and model_name == "rtmpose_x":
# Download config from HuggingFace
model_files = get_snapshot_folder_path()
model_files.mkdir(exist_ok=True)

path_model_config = Path(
huggingface_hub.hf_hub_download(
"DeepLabCut/HumanBody",
"rtmpose-x_simcc-body7_pytorch_config.yaml",
local_dir=model_files,
)
)
model_config = read_config_as_dict(path_model_config)
else:
# Use local config file for other models
model_cfg_path = get_super_animal_model_config_path(model_name=model_name, super_animal=super_animal)
model_config = read_config_as_dict(model_cfg_path)

model_config = add_metadata(project_config, model_config, model_cfg_path if 'model_cfg_path' in locals() else path_model_config)
model_cfg_path = get_super_animal_model_config_path(model_name=model_name)
model_config = read_config_as_dict(model_cfg_path)
model_config = add_metadata(project_config, model_config, model_cfg_path)
model_config = update_config(model_config, max_individuals, device)

if detector_name is None:
if detector_name is None and super_animal != "superanimal_humanbody":
model_config["method"] = "BU"
else:
# Check if this is a torchvision detector (not in dlclibrary)
if super_animal == "superanimal_humanbody" and detector_name == "fasterrcnn_mobilenet_v3_large_fpn":
# Use torchvision detector - set method to TD and load detector config
model_config["method"] = "TD"
detector_cfg_path = get_super_animal_model_config_path(model_name=detector_name, super_animal=super_animal)
model_config["method"] = "TD"
if super_animal != "superanimal_humanbody":
detector_cfg_path = get_super_animal_model_config_path(model_name=detector_name)
detector_cfg = read_config_as_dict(detector_cfg_path)
model_config["detector"] = detector_cfg
else:
# Load detector config from dlclibrary
detector_cfg_path = get_super_animal_model_config_path(model_name=detector_name, super_animal=super_animal)
detector_cfg = read_config_as_dict(detector_cfg_path)
model_config["method"] = "TD"
model_config["detector"] = detector_cfg

# Update config after detector is added (if any)
model_config = update_config(model_config, max_individuals, device)

# Add superanimal_name to metadata for all superanimal models (needed for detector routing)
if "metadata" not in model_config:
model_config["metadata"] = {}
model_config["metadata"]["superanimal_name"] = super_animal

return model_config


Expand Down