Spaces:
Sleeping
Sleeping
Matej
commited on
Commit
·
b8fb8cf
1
Parent(s):
7c3521c
debug
Browse files
my_app.py
CHANGED
@@ -23,14 +23,19 @@ This model is based on the EfficientNetB0 architecture and was trained on augmen
|
|
23 |
"""
|
24 |
|
25 |
def preprocess(image):
|
|
|
26 |
image = tf.image.resize(image, [224, 224])
|
|
|
27 |
image = tf.expand_dims(image, axis=0)
|
|
|
28 |
return image
|
29 |
|
30 |
def predict(model_selection, image):
|
31 |
# Choose the model based on the dropdown selection
|
32 |
model = model1 if model_selection == "EfficentNetB0 Fine Tune" else model2
|
33 |
|
|
|
|
|
34 |
image = preprocess(image)
|
35 |
prediction = model.predict(image)
|
36 |
print("model prediction", prediction)
|
|
|
23 |
"""
|
24 |
|
25 |
def preprocess(image):
|
26 |
+
print("before resize", image.shape)
|
27 |
image = tf.image.resize(image, [224, 224])
|
28 |
+
|
29 |
image = tf.expand_dims(image, axis=0)
|
30 |
+
print("After expanddims", image.shape)
|
31 |
return image
|
32 |
|
33 |
def predict(model_selection, image):
|
34 |
# Choose the model based on the dropdown selection
|
35 |
model = model1 if model_selection == "EfficentNetB0 Fine Tune" else model2
|
36 |
|
37 |
+
print(model.summary())
|
38 |
+
|
39 |
image = preprocess(image)
|
40 |
prediction = model.predict(image)
|
41 |
print("model prediction", prediction)
|