Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import tensorflow as tf
|
3 |
import numpy as np
|
4 |
-
from PIL import Image
|
5 |
import cv2
|
6 |
|
7 |
# Defina a camada personalizada FixedDropout
|
@@ -48,11 +48,11 @@ def classify_image(input_image):
|
|
48 |
y1 = (image_height - box_size) // 2
|
49 |
x2 = x1 + box_size
|
50 |
y2 = y1 + box_size
|
51 |
-
cv2.rectangle(output_image_with_box, (x1, y1), (x2, y2), (0, 255, 0), 2) #
|
52 |
|
53 |
-
# Escreva o r贸tulo de previs茫o no output_image_with_box (com
|
54 |
font = cv2.FONT_HERSHEY_SIMPLEX
|
55 |
-
cv2.putText(output_image_with_box, f"Predicted Class: {predicted_class}", (10, 20), font, 0.5, (0,
|
56 |
|
57 |
return output_image_with_box
|
58 |
|
|
|
1 |
import gradio as gr
|
2 |
import tensorflow as tf
|
3 |
import numpy as np
|
4 |
+
from PIL import Image
|
5 |
import cv2
|
6 |
|
7 |
# Defina a camada personalizada FixedDropout
|
|
|
48 |
y1 = (image_height - box_size) // 2
|
49 |
x2 = x1 + box_size
|
50 |
y2 = y1 + box_size
|
51 |
+
cv2.rectangle(output_image_with_box, (x1, y1), (x2, y2), (0, 255, 0), 2) # Caixa verde
|
52 |
|
53 |
+
# Escreva o r贸tulo de previs茫o no output_image_with_box (com a cor da caixa)
|
54 |
font = cv2.FONT_HERSHEY_SIMPLEX
|
55 |
+
cv2.putText(output_image_with_box, f"Predicted Class: {predicted_class}", (10, 20), font, 0.5, (0, 255, 0), 2) # Cor verde
|
56 |
|
57 |
return output_image_with_box
|
58 |
|