Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions deeplabcut/pose_estimation_pytorch/modelzoo/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# Licensed under GNU Lesser General Public License v3.0
#
import json
import logging
from pathlib import Path

import numpy as np
Expand All @@ -30,6 +31,8 @@
)
from deeplabcut.utils.make_labeled_video import create_video

logger = logging.getLogger(__name__)


class NumpyEncoder(json.JSONEncoder):
"""Special json encoder for numpy types."""
Expand Down Expand Up @@ -170,6 +173,8 @@ def _video_inference_superanimal(
pose_runner=pose_runner,
detector_runner=detector_runner,
)
if not predictions:
logger.warning(f"No pose predictions were made for video {video_path}. Were no individuals detected?")

Comment on lines +176 to 178
bbox_keys_in_predictions = {"bboxes", "bbox_scores"}
bboxes_list = [
Expand Down
3 changes: 2 additions & 1 deletion deeplabcut/pose_estimation_pytorch/modelzoo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def download_super_animal_snapshot(dataset: str, model_name: str) -> Path:
download_huggingface_model(
model_name,
target_dir=str(snapshot_dir),
rename_mapping={model_filename: model_filename},
# rename_mapping={model_filename: model_filename},
rename_mapping=model_filename,
)
Comment on lines 129 to 134
if not model_path.exists():
raise RuntimeError(f"Failed to download {model_name} to {model_path}")
Expand Down
Loading