Sara-Adjo commited on
Commit
37bdfa4
Β·
verified Β·
1 Parent(s): f38dd88

Update predict.py

Browse files
Files changed (1) hide show
  1. 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 β€” corrigΓ© pour incompatibilitΓ© Keras 2.x / 3.x
67
  # ════════════════════════════════════════════════════════════════════════════
68
 
69
- def predict_tensorflow(image_path: str, model_path: str = "sara_model.h5") -> dict:
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