Spaces:
Running
Running
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
@@ -23,9 +23,9 @@ cnn, vit, zero_shot, autoencoder, svm, iforest, gan = st.tabs(["CNN", "ViT", "Ze
|
|
23 |
@st.experimental_singleton
|
24 |
def predict(_model_list, _weights, _img):
|
25 |
y_gorrito = 0
|
26 |
-
raw_img = cv2.cvtColor(
|
27 |
-
img = cv2.resize(
|
28 |
-
for model, weight in zip(
|
29 |
y_gorrito += tf.cast(model(tf.expand_dims(img/255., 0)), dtype=tf.float32)*weight
|
30 |
return [y_gorrito / sum(weights), raw_img]
|
31 |
|
|
|
23 |
@st.experimental_singleton
|
24 |
def predict(_model_list, _weights, _img):
|
25 |
y_gorrito = 0
|
26 |
+
raw_img = cv2.cvtColor(_img, cv2.COLOR_BGR2RGB)
|
27 |
+
img = cv2.resize(_img, (IMAGE_WIDTH, IMAGE_HEIGHT))
|
28 |
+
for model, weight in zip(_model_list, _weights):
|
29 |
y_gorrito += tf.cast(model(tf.expand_dims(img/255., 0)), dtype=tf.float32)*weight
|
30 |
return [y_gorrito / sum(weights), raw_img]
|
31 |
|