DHEIVER commited on
Commit
8c2b840
1 Parent(s): 8659b9b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -38,15 +38,16 @@ def classify_image(input_image):
38
  # Adicionar o r贸tulo da previs茫o na imagem
39
  font = cv2.FONT_HERSHEY_SIMPLEX
40
  text = f'Previsao: {predicted_class_label}'
41
- text_size = cv2.getTextSize(text, font, 0.5, 1)[0]
42
  text_x = (input_image_bgr.shape[1] - text_size[0]) // 2
43
- text_y = input_image_bgr.shape[0] - 10
44
- cv2.putText(input_image_bgr, text, (text_x, text_y), font, 0.5, (255, 255, 255), 1)
45
 
46
  # Converter a imagem resultante de volta para RGB (formato Pillow)
47
  result_image = cv2.cvtColor(input_image_bgr, cv2.COLOR_BGR2RGB)
48
  return result_image
49
 
 
50
  # Criar uma interface Gradio
51
  interface = gr.Interface(
52
  fn=classify_image,
 
38
  # Adicionar o r贸tulo da previs茫o na imagem
39
  font = cv2.FONT_HERSHEY_SIMPLEX
40
  text = f'Previsao: {predicted_class_label}'
41
+ text_size = cv2.getTextSize(text, font, 0.7, 2)[0]
42
  text_x = (input_image_bgr.shape[1] - text_size[0]) // 2
43
+ text_y = input_image_bgr.shape[0] - 20
44
+ cv2.putText(input_image_bgr, text, (text_x, text_y), font, 0.7, (255, 255, 255), 2)
45
 
46
  # Converter a imagem resultante de volta para RGB (formato Pillow)
47
  result_image = cv2.cvtColor(input_image_bgr, cv2.COLOR_BGR2RGB)
48
  return result_image
49
 
50
+
51
  # Criar uma interface Gradio
52
  interface = gr.Interface(
53
  fn=classify_image,