Spaces:
Runtime error
Runtime error
AlshimaaGamalAlsaied
commited on
Commit
·
870f455
1
Parent(s):
5996601
commit
Browse files
app.py
CHANGED
|
@@ -32,14 +32,15 @@ def image_fn(
|
|
| 32 |
conf_threshold: Confidence threshold
|
| 33 |
iou_threshold: IOU threshold
|
| 34 |
Returns:
|
| 35 |
-
Rendered image
|
| 36 |
"""
|
| 37 |
|
| 38 |
model = yolov5.load(model_path, device="cpu", hf_model=True, trace=False)
|
| 39 |
model.conf = conf_threshold
|
| 40 |
model.iou = iou_threshold
|
| 41 |
results = model([image], size=image_size)
|
| 42 |
-
return results.render()[0]
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
|
|
|
|
| 32 |
conf_threshold: Confidence threshold
|
| 33 |
iou_threshold: IOU threshold
|
| 34 |
Returns:
|
| 35 |
+
Rendered image as PIL image object
|
| 36 |
"""
|
| 37 |
|
| 38 |
model = yolov5.load(model_path, device="cpu", hf_model=True, trace=False)
|
| 39 |
model.conf = conf_threshold
|
| 40 |
model.iou = iou_threshold
|
| 41 |
results = model([image], size=image_size)
|
| 42 |
+
return results.render()[0].astype('uint8')
|
| 43 |
+
|
| 44 |
|
| 45 |
|
| 46 |
|