mkhodary101 commited on
Commit
92e7cc9
·
verified ·
1 Parent(s): d65b7e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -435,7 +435,8 @@ class IntrusionDetectionEn:
435
  self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
436
  self.model = YOLO(self.model_path)
437
  self.model.to(self.device)
438
-
 
439
  def is_staff(self, person_crop):
440
  """Checks if the detected person is a staff member based on clothing color."""
441
  avg_color = np.mean(person_crop, axis=(0, 1)) # Compute average color (BGR)
@@ -448,7 +449,6 @@ class IntrusionDetectionEn:
448
  return True
449
  return False
450
 
451
- @spaces.GPU
452
  def intrusion_detect_en(self, video_path):
453
  try:
454
  cap = cv2.VideoCapture(video_path)
 
435
  self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
436
  self.model = YOLO(self.model_path)
437
  self.model.to(self.device)
438
+
439
+ @spaces.GPU
440
  def is_staff(self, person_crop):
441
  """Checks if the detected person is a staff member based on clothing color."""
442
  avg_color = np.mean(person_crop, axis=(0, 1)) # Compute average color (BGR)
 
449
  return True
450
  return False
451
 
 
452
  def intrusion_detect_en(self, video_path):
453
  try:
454
  cap = cv2.VideoCapture(video_path)