Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,11 +6,8 @@ from PIL import Image
|
|
6 |
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True)
|
7 |
|
8 |
def detect(image):
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
results = model(image) # inference
|
13 |
-
results.render() # updates results.imgs with boxes and labels
|
14 |
return Image.fromarray(results.imgs[0])
|
15 |
|
16 |
|
|
|
6 |
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True)
|
7 |
|
8 |
def detect(image):
|
9 |
+
results = model(image)
|
10 |
+
results.render()
|
|
|
|
|
|
|
11 |
return Image.fromarray(results.imgs[0])
|
12 |
|
13 |
|