Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,13 +8,13 @@ from PIL import Image
|
|
8 |
# Load MegaDetector v5a model
|
9 |
# TODO: Allow user selectable model?
|
10 |
# models = ["model_weights/md_v5a.0.0.pt","model_weights/md_v5b.0.0.pt"]
|
11 |
-
model = torch.hub.load('ultralytics/yolov5', 'custom', "model_weights/md_v5a.0.0.pt")
|
12 |
|
13 |
def yolo(im, size=640):
|
14 |
g = (size / max(im.size)) # gain
|
15 |
im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
16 |
|
17 |
-
model = torch.hub.load('ultralytics/yolov5', 'custom', "model_weights/md_v5a.0.0.pt")
|
18 |
|
19 |
results = model(im) # inference
|
20 |
results.render() # updates results.imgs with boxes and labels
|
|
|
8 |
# Load MegaDetector v5a model
|
9 |
# TODO: Allow user selectable model?
|
10 |
# models = ["model_weights/md_v5a.0.0.pt","model_weights/md_v5b.0.0.pt"]
|
11 |
+
model = torch.hub.load('ultralytics/yolov5:v6.2', 'custom', "model_weights/md_v5a.0.0.pt")
|
12 |
|
13 |
def yolo(im, size=640):
|
14 |
g = (size / max(im.size)) # gain
|
15 |
im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
16 |
|
17 |
+
model = torch.hub.load('ultralytics/yolov5:v6.2', 'custom', "model_weights/md_v5a.0.0.pt")
|
18 |
|
19 |
results = model(im) # inference
|
20 |
results.render() # updates results.imgs with boxes and labels
|