Spaces:
Running
Running
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
@@ -56,13 +56,14 @@ with cnn:
|
|
56 |
@tf.function
|
57 |
def tf_predict(model_list, img): #faster, but for few formats
|
58 |
y_gorrito = 0
|
59 |
-
|
60 |
-
|
61 |
for model in model_list:
|
62 |
y_gorrito += tf.cast(model(tf.expand_dims(img/255., 0)), dtype=tf.float32)
|
63 |
return [y_gorrito / len(model_list), raw_img]
|
64 |
|
65 |
def basic_predict(model_list, img): #for non-supported formats
|
|
|
66 |
raw_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
67 |
img = cv2.resize(img, (IMAGE_WIDTH, IMAGE_HEIGHT))
|
68 |
for model in model_list:
|
|
|
56 |
@tf.function
|
57 |
def tf_predict(model_list, img): #faster, but for few formats
|
58 |
y_gorrito = 0
|
59 |
+
raw_img = tf.image.decode_image(img, channels=3)
|
60 |
+
img = tf.image.resize(raw_img,(IMAGE_WIDTH, IMAGE_HEIGHT))
|
61 |
for model in model_list:
|
62 |
y_gorrito += tf.cast(model(tf.expand_dims(img/255., 0)), dtype=tf.float32)
|
63 |
return [y_gorrito / len(model_list), raw_img]
|
64 |
|
65 |
def basic_predict(model_list, img): #for non-supported formats
|
66 |
+
y_gorrito = 0
|
67 |
raw_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
68 |
img = cv2.resize(img, (IMAGE_WIDTH, IMAGE_HEIGHT))
|
69 |
for model in model_list:
|