Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,12 +71,12 @@ gender_model.fc = nn.Sequential(
|
|
| 71 |
nn.Dropout(0.4),
|
| 72 |
nn.Linear(in_features=512, out_features=2, bias=False)
|
| 73 |
)
|
| 74 |
-
age_model.load_state_dict(torch.load('
|
| 75 |
-
gender_model.load_state_dict(torch.load('
|
| 76 |
|
| 77 |
# Load the violence detection model
|
| 78 |
-
violence_model = load_model('
|
| 79 |
-
MODEL = "
|
| 80 |
yolo_model = YOLO(MODEL)
|
| 81 |
|
| 82 |
# Function to preprocess image for detection
|
|
|
|
| 71 |
nn.Dropout(0.4),
|
| 72 |
nn.Linear(in_features=512, out_features=2, bias=False)
|
| 73 |
)
|
| 74 |
+
age_model.load_state_dict(torch.load('agetest_mobilevit_V_1.1.pt', map_location=torch.device('cpu')))
|
| 75 |
+
gender_model.load_state_dict(torch.load('gendertest_mobilevit_V_1.1.pt', map_location=torch.device('cpu')))
|
| 76 |
|
| 77 |
# Load the violence detection model
|
| 78 |
+
violence_model = load_model('modelnew.h5')
|
| 79 |
+
MODEL = "yolov8_people.pt"
|
| 80 |
yolo_model = YOLO(MODEL)
|
| 81 |
|
| 82 |
# Function to preprocess image for detection
|