UltralyticsAssistant 5 months ago
parent e1ff0aaf9a
commit 1d2aa2bfc3
  1. 6
      ultralytics/solutions/action_recognition.py
  2. 1
      ultralytics/utils/__init__.py

@ -1,7 +1,7 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
from collections import defaultdict
from typing import List, Optional, Tuple
from typing import List, Tuple
import cv2
import numpy as np
@ -45,7 +45,7 @@ class ActionRecognition:
)
self.device = select_device(device)
self.fp16 = torch.cuda.is_available() and torch.cuda.is_bf16_supported() and 'cuda' in self.device
self.fp16 = torch.cuda.is_available() and torch.cuda.is_bf16_supported() and "cuda" in self.device
# Check if environment supports imshow
self.env_check = check_imshow(warn=True)
@ -58,7 +58,7 @@ class ActionRecognition:
self.video_classifier = TorchVisionVideoClassifier(video_classifier_model, device=self.device)
else:
self.video_classifier = HuggingFaceVideoClassifier(
self.labels, model_name=video_classifier_model, device=self.device, fp16= self.fp16
self.labels, model_name=video_classifier_model, device=self.device, fp16=self.fp16
)
self.track_history = defaultdict(list)

@ -1280,7 +1280,6 @@ def crop_and_pad(frame, box, margin_percent):
return cv2.resize(square_crop, (224, 224), interpolation=cv2.INTER_LINEAR)
# Run below code on utils init ------------------------------------------------------------------------------------
# Check first-install steps

Loading…
Cancel
Save