Spaces:
Build error
Build error
napatswift
commited on
Commit
•
e7d3991
1
Parent(s):
83c123b
Fix put text bug
Browse files
main.py
CHANGED
@@ -28,13 +28,13 @@ def predict(image_input, score_threshold):
|
|
28 |
|
29 |
p0, p1 = get_rec([int(i) for i in polygon])
|
30 |
draw_img = cv2.rectangle(draw_img, p0, p1, (255,0,0), 2)
|
31 |
-
draw_img = cv2.putText(draw_img, '%.3f' % score, p0)
|
32 |
return draw_img
|
33 |
|
34 |
def run():
|
35 |
demo = gr.Interface(
|
36 |
fn=predict,
|
37 |
-
inputs=[gr.components.Image(), gr.Slider(0, 1)],
|
38 |
outputs=gr.components.Image(),
|
39 |
)
|
40 |
|
|
|
28 |
|
29 |
p0, p1 = get_rec([int(i) for i in polygon])
|
30 |
draw_img = cv2.rectangle(draw_img, p0, p1, (255,0,0), 2)
|
31 |
+
draw_img = cv2.putText(draw_img, '%.3f' % score, p0, cv2.FONT_HERSHEY_PLAIN, 2)
|
32 |
return draw_img
|
33 |
|
34 |
def run():
|
35 |
demo = gr.Interface(
|
36 |
fn=predict,
|
37 |
+
inputs=[gr.components.Image(), gr.Slider(0, 1, 0.8)],
|
38 |
outputs=gr.components.Image(),
|
39 |
)
|
40 |
|