Delete predict.py
Browse files- predict.py +0 -23
predict.py
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
import tensorflow as tf
|
| 2 |
-
import numpy as np
|
| 3 |
-
|
| 4 |
-
from preprocessing import preprocess
|
| 5 |
-
from labels import classes
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
model = tf.keras.models.load_model("hand_gesture_model.keras")
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
def predict_image(image):
|
| 12 |
-
|
| 13 |
-
image = preprocess(image)
|
| 14 |
-
|
| 15 |
-
prediction = model.predict(image)[0]
|
| 16 |
-
|
| 17 |
-
results = {}
|
| 18 |
-
|
| 19 |
-
for i,prob in enumerate(prediction):
|
| 20 |
-
|
| 21 |
-
results[classes[i]] = float(prob)
|
| 22 |
-
|
| 23 |
-
return results
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|