Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import tensorflow as tf
|
|
| 5 |
from PIL import Image
|
| 6 |
|
| 7 |
def apply_random_mask(img):
|
| 8 |
-
mask_size =
|
| 9 |
y1, x1 = np.random.randint(0, img.shape[0] - mask_size, 1)[0], np.random.randint(0, img.shape[1] - mask_size, 1)[0]
|
| 10 |
y2, x2 = y1 + mask_size, x1 + mask_size
|
| 11 |
|
|
@@ -26,7 +26,7 @@ def preprocess_image(image):
|
|
| 26 |
return image
|
| 27 |
|
| 28 |
def predict(image):
|
| 29 |
-
model = tf.keras.models.load_model("
|
| 30 |
processed_image = preprocess_image(image)
|
| 31 |
input_image = np.expand_dims(processed_image, axis=0)
|
| 32 |
output_image = model.predict(input_image)[0]
|
|
|
|
| 5 |
from PIL import Image
|
| 6 |
|
| 7 |
def apply_random_mask(img):
|
| 8 |
+
mask_size = 50
|
| 9 |
y1, x1 = np.random.randint(0, img.shape[0] - mask_size, 1)[0], np.random.randint(0, img.shape[1] - mask_size, 1)[0]
|
| 10 |
y2, x2 = y1 + mask_size, x1 + mask_size
|
| 11 |
|
|
|
|
| 26 |
return image
|
| 27 |
|
| 28 |
def predict(image):
|
| 29 |
+
model = tf.keras.models.load_model("initial_generator_model2.keras")
|
| 30 |
processed_image = preprocess_image(image)
|
| 31 |
input_image = np.expand_dims(processed_image, axis=0)
|
| 32 |
output_image = model.predict(input_image)[0]
|