DHEIVER commited on
Commit
700be79
1 Parent(s): 8dc8a0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -56,17 +56,14 @@ def classify_image(input_image):
56
  y2 = y1 + box_size
57
  cv2.rectangle(output_image_with_box, (x1, y1), (x2, y2), (0, 255, 0), 2) # Caixa verde
58
 
59
- # Escreva o r贸tulo de previs茫o no output_image_with_box (com a cor da caixa e estat铆sticas)
60
  font = cv2.FONT_HERSHEY_SIMPLEX
61
  font_scale = 0.4 # Tamanho da fonte reduzido
62
  cv2.putText(output_image_with_box, f"Predicted Class: {predicted_class}", (10, 20), font, font_scale, (0, 255, 0), 1) # Cor verde
63
 
64
- # Adicione estat铆sticas (substitua com suas pr贸prias estat铆sticas)
65
- stats = f"Accuracy: {prediction[0][class_index]:.2f}, Confidence: {prediction[0].max():.2f}"
66
- cv2.putText(output_image_with_box, stats, (10, 40), font, font_scale, (0, 255, 0), 1)
67
-
68
  return output_image_with_box
69
 
 
70
  # Crie uma interface Gradio
71
  input_interface = gr.Interface(
72
  fn=classify_image,
 
56
  y2 = y1 + box_size
57
  cv2.rectangle(output_image_with_box, (x1, y1), (x2, y2), (0, 255, 0), 2) # Caixa verde
58
 
59
+ # Escreva o r贸tulo de previs茫o no output_image_with_box (com a cor da caixa)
60
  font = cv2.FONT_HERSHEY_SIMPLEX
61
  font_scale = 0.4 # Tamanho da fonte reduzido
62
  cv2.putText(output_image_with_box, f"Predicted Class: {predicted_class}", (10, 20), font, font_scale, (0, 255, 0), 1) # Cor verde
63
 
 
 
 
 
64
  return output_image_with_box
65
 
66
+
67
  # Crie uma interface Gradio
68
  input_interface = gr.Interface(
69
  fn=classify_image,