Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import numpy as np
|
| 4 |
from PIL import Image
|
| 5 |
import torchvision.transforms as transforms
|
| 6 |
-
from model import
|
| 7 |
from utils import cellboxes_to_boxes, non_max_suppression
|
| 8 |
import cv2
|
| 9 |
import os
|
|
@@ -35,7 +35,7 @@ except Exception as e:
|
|
| 35 |
print("Tentative de chargement local...")
|
| 36 |
model_path = MODEL_FILENAME
|
| 37 |
|
| 38 |
-
model =
|
| 39 |
checkpoint = torch.load(model_path, map_location=DEVICE)
|
| 40 |
model.load_state_dict(checkpoint["state_dict"])
|
| 41 |
model.eval()
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
from PIL import Image
|
| 5 |
import torchvision.transforms as transforms
|
| 6 |
+
from model import Yolo_V1
|
| 7 |
from utils import cellboxes_to_boxes, non_max_suppression
|
| 8 |
import cv2
|
| 9 |
import os
|
|
|
|
| 35 |
print("Tentative de chargement local...")
|
| 36 |
model_path = MODEL_FILENAME
|
| 37 |
|
| 38 |
+
model = Yolo_V1(split_size=7, num_boxes=2, num_classes=20).to(DEVICE)
|
| 39 |
checkpoint = torch.load(model_path, map_location=DEVICE)
|
| 40 |
model.load_state_dict(checkpoint["state_dict"])
|
| 41 |
model.eval()
|