Spaces:
Running
Running
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
@@ -27,7 +27,7 @@ def predict(_model_list, _weights, _img):
|
|
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(
|
31 |
|
32 |
def preprocess(file_uploader, module = 'cv2'): #makes the uploaded image readable
|
33 |
img = np.frombuffer(uploaded_file.read(), np.uint8)
|
|
|
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 |
|
32 |
def preprocess(file_uploader, module = 'cv2'): #makes the uploaded image readable
|
33 |
img = np.frombuffer(uploaded_file.read(), np.uint8)
|