Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,7 @@ model.hide_conf=True
|
|
15 |
def detect(inp):
|
16 |
#g = (size / max(inp.size)) # gain
|
17 |
#im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
|
|
18 |
results = model(inp,size=640) # inference
|
19 |
results.render() # updates results.imgs with boxes and labels
|
20 |
return Image.fromarray(results.imgs[0])
|
|
|
15 |
def detect(inp):
|
16 |
#g = (size / max(inp.size)) # gain
|
17 |
#im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
18 |
+
inp=Image.open(inp)
|
19 |
results = model(inp,size=640) # inference
|
20 |
results.render() # updates results.imgs with boxes and labels
|
21 |
return Image.fromarray(results.imgs[0])
|