Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,7 @@ from ultralytics import YOLO
|
|
7 |
import spaces
|
8 |
import os
|
9 |
import logging
|
|
|
10 |
|
11 |
# Set up logging for Spaces
|
12 |
logging.basicConfig(
|
@@ -33,7 +34,6 @@ class CrowdDetection:
|
|
33 |
logger.error(f"Failed to initialize model: {str(e)}")
|
34 |
raise
|
35 |
|
36 |
-
@spaces.GPU
|
37 |
def detect_crowd(self, video_path):
|
38 |
logger.info(f"Processing video for crowd detection: {video_path}")
|
39 |
try:
|
@@ -104,7 +104,6 @@ class PeopleTracking:
|
|
104 |
self.model = YOLO(yolo_model_path)
|
105 |
self.model.to(self.device)
|
106 |
|
107 |
-
@spaces.GPU
|
108 |
def track_people(self, video_path):
|
109 |
logger.info(f"Tracking people in video: {video_path}")
|
110 |
try:
|
@@ -160,7 +159,6 @@ class FallDetection:
|
|
160 |
self.model = YOLO(yolo_model_path)
|
161 |
self.model.to(self.device)
|
162 |
|
163 |
-
@spaces.GPU
|
164 |
def detect_fall(self, video_path):
|
165 |
logger.info(f"Detecting falls in video: {video_path}")
|
166 |
try:
|
@@ -226,7 +224,6 @@ class FightDetection:
|
|
226 |
self.model = YOLO(yolo_model_path)
|
227 |
self.model.to(self.device)
|
228 |
|
229 |
-
@spaces.GPU
|
230 |
def detect_fight(self, video_path):
|
231 |
logger.info(f"Detecting fights in video: {video_path}")
|
232 |
try:
|
|
|
7 |
import spaces
|
8 |
import os
|
9 |
import logging
|
10 |
+
@spaces.GPU
|
11 |
|
12 |
# Set up logging for Spaces
|
13 |
logging.basicConfig(
|
|
|
34 |
logger.error(f"Failed to initialize model: {str(e)}")
|
35 |
raise
|
36 |
|
|
|
37 |
def detect_crowd(self, video_path):
|
38 |
logger.info(f"Processing video for crowd detection: {video_path}")
|
39 |
try:
|
|
|
104 |
self.model = YOLO(yolo_model_path)
|
105 |
self.model.to(self.device)
|
106 |
|
|
|
107 |
def track_people(self, video_path):
|
108 |
logger.info(f"Tracking people in video: {video_path}")
|
109 |
try:
|
|
|
159 |
self.model = YOLO(yolo_model_path)
|
160 |
self.model.to(self.device)
|
161 |
|
|
|
162 |
def detect_fall(self, video_path):
|
163 |
logger.info(f"Detecting falls in video: {video_path}")
|
164 |
try:
|
|
|
224 |
self.model = YOLO(yolo_model_path)
|
225 |
self.model.to(self.device)
|
226 |
|
|
|
227 |
def detect_fight(self, video_path):
|
228 |
logger.info(f"Detecting fights in video: {video_path}")
|
229 |
try:
|