sergioska commited on
Commit
26ab4c7
·
1 Parent(s): 23bb0b4

add a button to apply tags

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -57,7 +57,7 @@ if st.button('apply tag'):
57
  candidate_labels=['eggs', 'apple', 'pear']
58
  )
59
 
60
- draw = ImageDraw.Draw(outputImage)
61
 
62
  for prediction in predictions:
63
  box = prediction["box"]
@@ -68,6 +68,7 @@ if st.button('apply tag'):
68
  draw.rectangle((xmin, ymin, xmax, ymax), outline="red", width=1)
69
  draw.text((xmin, ymin), f"{label}: {round(score,2)}", fill="white")
70
 
71
- st.image(outputImage)
 
72
  st.write(predictions)
73
 
 
57
  candidate_labels=['eggs', 'apple', 'pear']
58
  )
59
 
60
+ draw = ImageDraw.Draw(image)
61
 
62
  for prediction in predictions:
63
  box = prediction["box"]
 
68
  draw.rectangle((xmin, ymin, xmax, ymax), outline="red", width=1)
69
  draw.text((xmin, ymin), f"{label}: {round(score,2)}", fill="white")
70
 
71
+ outputImageWithLabel = np.array(image)
72
+ st.image(outputImageWithLabel)
73
  st.write(predictions)
74