import torch from ultralytics import YOLO class Models: def __init__(self,device=None): self.device = 'cpu' if device=='cpu' else device if device else ('cuda' if torch.cuda.is_available() else 'cpu') self.daModel = YOLO("AI_Models/DA.pt").to(self.device) self.st_orientation = YOLO("AI_Models/st_orientation.pt").to(self.device) self.exclusivity_model = YOLO("AI_Models/exclusivity.pt").to(self.device) if 'cuda' in self.device: torch.cuda.empty_cache()