Spaces:
Running
Running
cleaned up app.py
Browse files
app.py
CHANGED
@@ -13,24 +13,7 @@ model.conf = 0.20 # NMS confidence threshold
|
|
13 |
|
14 |
path = [['img/test-image.jpg'], ['img/test-image-2.jpg']]
|
15 |
|
16 |
-
# def show_preds_image(image_path):
|
17 |
-
# image = cv2.imread(image_path)
|
18 |
-
# outputs = model.predict(source=image_path)
|
19 |
-
# results = outputs[0].cpu().numpy()
|
20 |
-
# for i, det in enumerate(results.boxes.xyxy):
|
21 |
-
# cv2.rectangle(
|
22 |
-
# image,
|
23 |
-
# (int(det[0]), int(det[1])),
|
24 |
-
# (int(det[2]), int(det[3])),
|
25 |
-
# color=(0, 0, 255),
|
26 |
-
# thickness=2,
|
27 |
-
# lineType=cv2.LINE_AA
|
28 |
-
# )
|
29 |
-
# return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
30 |
-
|
31 |
def show_preds_image(im):
|
32 |
-
#g = (size / max(im.size)) # gain
|
33 |
-
#im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
34 |
|
35 |
results = model(im) # inference
|
36 |
return results.render()[0]
|
|
|
13 |
|
14 |
path = [['img/test-image.jpg'], ['img/test-image-2.jpg']]
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
def show_preds_image(im):
|
|
|
|
|
17 |
|
18 |
results = model(im) # inference
|
19 |
return results.render()[0]
|