Create main.py
Browse files
main.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from prediction import predict_class
|
| 2 |
+
import tensorflow as tf
|
| 3 |
+
|
| 4 |
+
# Cargar el modelo
|
| 5 |
+
new_model = tf.keras.models.load_model('fruits_detection.keras')
|
| 6 |
+
|
| 7 |
+
# Funci贸n para manejar la solicitud de predicci贸n
|
| 8 |
+
def predict_image(image_path):
|
| 9 |
+
predicted_class = predict_class(new_model, image_path)
|
| 10 |
+
return {"predicted_class": predicted_class}
|