Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,18 +46,18 @@ def classify_image(input_image):
|
|
46 |
# Crie uma imagem composta com o r贸tulo de previs茫o
|
47 |
output_image = (input_image[0] * 255).astype('uint8')
|
48 |
|
49 |
-
#
|
|
|
|
|
|
|
50 |
font = cv2.FONT_HERSHEY_SIMPLEX
|
51 |
font_scale = 0.4 # Tamanho da fonte reduzido
|
52 |
-
|
53 |
-
|
54 |
-
current_time = datetime.datetime.now()
|
55 |
-
cv2.putText(output_image, f"Analysis Time: {current_time.strftime('%Y-%m-%d %H:%M:%S')}", (10, 40), font, font_scale, (0, 255, 0), 1)
|
56 |
-
|
57 |
-
cv2.putText(output_image, f"Predicted Class: {predicted_class}", (10, 60), font, font_scale, (0, 255, 0), 1) # Cor verde
|
58 |
|
59 |
return output_image
|
60 |
|
|
|
61 |
# Crie uma interface Gradio
|
62 |
input_interface = gr.Interface(
|
63 |
fn=classify_image,
|
|
|
46 |
# Crie uma imagem composta com o r贸tulo de previs茫o
|
47 |
output_image = (input_image[0] * 255).astype('uint8')
|
48 |
|
49 |
+
# Adicione espa莽o para o r贸tulo de previs茫o na parte inferior da imagem
|
50 |
+
output_image = cv2.copyMakeBorder(output_image, 0, 50, 0, 0, cv2.BORDER_CONSTANT, value=(255, 255, 255))
|
51 |
+
|
52 |
+
# Escreva o r贸tulo de previs茫o na imagem
|
53 |
font = cv2.FONT_HERSHEY_SIMPLEX
|
54 |
font_scale = 0.4 # Tamanho da fonte reduzido
|
55 |
+
cv2.putText(output_image, f"Analysis Time: {current_time.strftime('%Y-%m-%d %H:%M:%S')}", (10, 20), font, font_scale, (0, 0, 0), 1)
|
56 |
+
cv2.putText(output_image, f"Predicted Class: {predicted_class}", (10, 40), font, font_scale, (0, 0, 0), 1) # Cor preta
|
|
|
|
|
|
|
|
|
57 |
|
58 |
return output_image
|
59 |
|
60 |
+
|
61 |
# Crie uma interface Gradio
|
62 |
input_interface = gr.Interface(
|
63 |
fn=classify_image,
|