Spaces:
Sleeping
Sleeping
Update predict.py
Browse files- predict.py +2 -8
predict.py
CHANGED
|
@@ -1,9 +1,3 @@
|
|
| 1 |
-
"""
|
| 2 |
-
predict.py
|
| 3 |
-
----------
|
| 4 |
-
Charge un modèle sauvegardé et prédit la classe d'une image.
|
| 5 |
-
CorrigΓ© pour gΓ©rer les incompatibilitΓ©s de version Keras.
|
| 6 |
-
"""
|
| 7 |
|
| 8 |
import argparse
|
| 9 |
import numpy as np
|
|
@@ -63,10 +57,10 @@ def predict_pytorch(image_path: str, model_path: str = "sara_model.pth") -> dict
|
|
| 63 |
|
| 64 |
|
| 65 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 66 |
-
# TensorFlow Prediction
|
| 67 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 68 |
|
| 69 |
-
def predict_tensorflow(image_path: str, model_path: str = "sara_model.
|
| 70 |
import tensorflow as tf
|
| 71 |
import numpy as np
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
import argparse
|
| 3 |
import numpy as np
|
|
|
|
| 57 |
|
| 58 |
|
| 59 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 60 |
+
# TensorFlow Prediction
|
| 61 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 62 |
|
| 63 |
+
def predict_tensorflow(image_path: str, model_path: str = "sara_model.keras") -> dict:
|
| 64 |
import tensorflow as tf
|
| 65 |
import numpy as np
|
| 66 |
|