Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,11 @@ def visualize_prediction(pil_img, output_dict, threshold=0.5, id2label=None):
|
|
44 |
labels = [id2label[x] for x in labels]
|
45 |
|
46 |
plt.figure(figsize=(18, 13))
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
ax = plt.gca()
|
49 |
colors = COLORS * 100
|
50 |
for score, (xmin, ymin, xmax, ymax), label, color in zip(scores, boxes, labels, colors):
|
|
|
44 |
labels = [id2label[x] for x in labels]
|
45 |
|
46 |
plt.figure(figsize=(18, 13))
|
47 |
+
basewidth = 750
|
48 |
+
wpercent = (basewidth/float(pil_img.size[0]))
|
49 |
+
hsize = int((float(pil_img.size[1])*float(wpercent)))
|
50 |
+
img = pil_img.resize((basewidth,hsize), Image.ANTIALIAS)
|
51 |
+
p
|
52 |
ax = plt.gca()
|
53 |
colors = COLORS * 100
|
54 |
for score, (xmin, ymin, xmax, ymax), label, color in zip(scores, boxes, labels, colors):
|