Spaces:
Runtime error
Runtime error
ossaili
commited on
Commit
·
6561418
1
Parent(s):
acbbc7d
na
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import numpy as np
|
2 |
-
|
3 |
import gradio as gr
|
4 |
from models import efficientnetv2b0_25_arch_styles_Classifier
|
5 |
|
|
|
1 |
import numpy as np
|
2 |
+
import tensorflow as tf
|
3 |
import gradio as gr
|
4 |
from models import efficientnetv2b0_25_arch_styles_Classifier
|
5 |
|
models.py
CHANGED
@@ -34,15 +34,12 @@ def outputs(y):
|
|
34 |
|
35 |
|
36 |
def efficientnetv2b0_25_arch_styles_Classifier(image):
|
37 |
-
|
38 |
-
# with open(file_path, "wb") as f:
|
39 |
-
# f.write(file.file.read())
|
40 |
resized_image = cv2.resize(image, dsize=(
|
41 |
224, 224), interpolation=cv2.INTER_CUBIC)
|
42 |
img = tf.expand_dims(resized_image, 0)
|
43 |
efficientnetv2b0 = tf.keras.models.load_model(
|
44 |
-
"
|
45 |
-
|
46 |
y = efficientnetv2b0.predict(img).reshape(-1)
|
47 |
y = (np.round(y, 3)).tolist()
|
48 |
|
|
|
34 |
|
35 |
|
36 |
def efficientnetv2b0_25_arch_styles_Classifier(image):
|
37 |
+
|
|
|
|
|
38 |
resized_image = cv2.resize(image, dsize=(
|
39 |
224, 224), interpolation=cv2.INTER_CUBIC)
|
40 |
img = tf.expand_dims(resized_image, 0)
|
41 |
efficientnetv2b0 = tf.keras.models.load_model(
|
42 |
+
"EfficientNetV2B0.h5")
|
|
|
43 |
y = efficientnetv2b0.predict(img).reshape(-1)
|
44 |
y = (np.round(y, 3)).tolist()
|
45 |
|