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
Revert base Runner
  • Loading branch information
maximpavliv committed Jul 21, 2025
commit bba86890a4ed252e48801702f2ab062492ae6668
38 changes: 1 addition & 37 deletions deeplabcut/pose_estimation_pytorch/runners/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,43 +114,7 @@ def load_snapshot(
The content of the snapshot file.
"""
snapshot = attempt_snapshot_load(snapshot_path, device, weights_only)

# Handle the case where snapshot keys have 'model.' prefix
snapshot_weights = snapshot["model"]
model_state_dict = model.state_dict()

# Diagnostic: Always add 'model.' prefix for superanimal_topviewmouse detectors
is_topviewmouse = hasattr(model, 'superanimal_name') and getattr(model, 'superanimal_name', None) == 'superanimal_topviewmouse'
is_detector = 'FasterRCNN' in str(type(model)) or 'SSDLite' in str(type(model))
if is_topviewmouse and is_detector:
print(f"DEBUG: Forcing prefix ADD for superanimal_topviewmouse detector!")
cleaned_weights = {}
for key, value in snapshot_weights.items():
if not key.startswith('model.'):
cleaned_key = 'model.' + key # Add 'model.' prefix
cleaned_weights[cleaned_key] = value
else:
cleaned_weights[key] = value
print(f"DEBUG: Loading cleaned weights with {len(cleaned_weights)} keys")
model.load_state_dict(cleaned_weights)
elif (any(key.startswith('model.') for key in snapshot_weights.keys()) and
not any(key.startswith('model.') for key in model_state_dict.keys())):
print(f"DEBUG: Detected 'model.' prefix mismatch, cleaning keys...")
# Strip the 'model.' prefix from snapshot keys
cleaned_weights = {}
for key, value in snapshot_weights.items():
if key.startswith('model.'):
cleaned_key = key[6:] # Remove 'model.' prefix
cleaned_weights[cleaned_key] = value
else:
cleaned_weights[key] = value
print(f"DEBUG: Loading cleaned weights with {len(cleaned_weights)} keys")
model.load_state_dict(cleaned_weights)
else:
print(f"DEBUG: No prefix mismatch, loading original weights")
# Use original snapshot weights
model.load_state_dict(snapshot["model"])

model.load_state_dict(snapshot["model"])
return snapshot


Expand Down