User00100 commited on
Commit
5d2f9f4
·
verified ·
1 Parent(s): 4f0ee6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,6 @@ processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
8
  model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
9
 
10
  def detect_objects(video_path):
11
- # Leer el video
12
  cap = cv2.VideoCapture(video_path)
13
  results = []
14
 
@@ -23,7 +22,8 @@ def detect_objects(video_path):
23
 
24
  # Extraer las predicciones
25
  target_sizes = torch.tensor([frame.shape[:2]])
26
- results.append(processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0])
 
27
 
28
  cap.release()
29
  return results
 
8
  model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
9
 
10
  def detect_objects(video_path):
 
11
  cap = cv2.VideoCapture(video_path)
12
  results = []
13
 
 
22
 
23
  # Extraer las predicciones
24
  target_sizes = torch.tensor([frame.shape[:2]])
25
+ detections = processor.post_process_object_detection(outputs, target_sizes=target_sizes, threshold=0.9)[0]
26
+ results.append(detections)
27
 
28
  cap.release()
29
  return results