Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,6 +69,9 @@ class ImageClassifierCataract:
|
|
69 |
object_box_color = (255, 0, 0)
|
70 |
cv2.rectangle(output_image, (box_x, box_y), (box_x + box_size, box_y + box_size), object_box_color, 2)
|
71 |
|
|
|
|
|
|
|
72 |
return output_image
|
73 |
|
74 |
def run_interface(self):
|
@@ -83,4 +86,4 @@ class ImageClassifierCataract:
|
|
83 |
if __name__ == "__main__":
|
84 |
model_path = 'modelo_treinado.h5' # Replace with the path to your trained model
|
85 |
app = ImageClassifierCataract(model_path)
|
86 |
-
app.run_interface()
|
|
|
69 |
object_box_color = (255, 0, 0)
|
70 |
cv2.rectangle(output_image, (box_x, box_y), (box_x + box_size, box_y + box_size), object_box_color, 2)
|
71 |
|
72 |
+
# Crop the output image to keep only the region of interest
|
73 |
+
output_image = output_image[box_y:box_y+box_size, box_x:box_x+box_size]
|
74 |
+
|
75 |
return output_image
|
76 |
|
77 |
def run_interface(self):
|
|
|
86 |
if __name__ == "__main__":
|
87 |
model_path = 'modelo_treinado.h5' # Replace with the path to your trained model
|
88 |
app = ImageClassifierCataract(model_path)
|
89 |
+
app.run_interface()
|