Spaces:
Sleeping
Sleeping
app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,6 @@ images = load_images()
|
|
33 |
if st.button("Random Pick"):
|
34 |
st.session_state.random_idx = random.randint(0, images.shape[0] - 1)
|
35 |
|
36 |
-
|
37 |
def run_inpainting(random_idx, mask_array, image_queue, sampling_queue):
|
38 |
"""Starts inpainting and sends images to the queue."""
|
39 |
vipainting.vipaint(random_idx, mask_array, image_queue, sampling_queue)
|
@@ -70,7 +69,8 @@ if st.session_state.random_idx is not None:
|
|
70 |
st.image(binary_mask, caption="Binary Mask", width=300)
|
71 |
|
72 |
|
73 |
-
mask_image = Image.fromarray(binary_mask)
|
|
|
74 |
mask_array = 255 - np.array(mask_image)
|
75 |
mask_array = np.expand_dims(mask_array, axis=(0, 1))
|
76 |
|
|
|
33 |
if st.button("Random Pick"):
|
34 |
st.session_state.random_idx = random.randint(0, images.shape[0] - 1)
|
35 |
|
|
|
36 |
def run_inpainting(random_idx, mask_array, image_queue, sampling_queue):
|
37 |
"""Starts inpainting and sends images to the queue."""
|
38 |
vipainting.vipaint(random_idx, mask_array, image_queue, sampling_queue)
|
|
|
69 |
st.image(binary_mask, caption="Binary Mask", width=300)
|
70 |
|
71 |
|
72 |
+
mask_image = Image.fromarray(binary_mask).resize((512, 512))
|
73 |
+
|
74 |
mask_array = 255 - np.array(mask_image)
|
75 |
mask_array = np.expand_dims(mask_array, axis=(0, 1))
|
76 |
|