Spaces:
Sleeping
Sleeping
Commit
·
cbb2900
1
Parent(s):
077e104
bug fix
Browse files
app.py
CHANGED
|
@@ -36,10 +36,6 @@ def show_image(img, title):
|
|
| 36 |
img = rearrange(img, "c h w -> h w c")
|
| 37 |
img = (img.cpu().detach().numpy() + 1) / 2 # Normalize to [0, 1]
|
| 38 |
|
| 39 |
-
plt.imshow(img)
|
| 40 |
-
plt.axis('off')
|
| 41 |
-
plt.title(title)
|
| 42 |
-
|
| 43 |
# Visualize a Single Image
|
| 44 |
def visualize_single_image(image_path):
|
| 45 |
img = load_image(image_path, transform).to(device)
|
|
@@ -56,8 +52,8 @@ def visualize_single_image(image_path):
|
|
| 56 |
# MAE reconstruction pasted with visible patches
|
| 57 |
im_paste = img * (1 - mask) + predicted_img * mask
|
| 58 |
|
| 59 |
-
|
| 60 |
-
img = img
|
| 61 |
|
| 62 |
# # make the plt figure larger
|
| 63 |
# plt.figure(figsize=(12, 4))
|
|
|
|
| 36 |
img = rearrange(img, "c h w -> h w c")
|
| 37 |
img = (img.cpu().detach().numpy() + 1) / 2 # Normalize to [0, 1]
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
# Visualize a Single Image
|
| 40 |
def visualize_single_image(image_path):
|
| 41 |
img = load_image(image_path, transform).to(device)
|
|
|
|
| 52 |
# MAE reconstruction pasted with visible patches
|
| 53 |
im_paste = img * (1 - mask) + predicted_img * mask
|
| 54 |
|
| 55 |
+
img = rearrange(img[0], "c h w -> h w c")
|
| 56 |
+
img = (img.cpu().detach().numpy() + 1) / 2 # Normalize to [0, 1]
|
| 57 |
|
| 58 |
# # make the plt figure larger
|
| 59 |
# plt.figure(figsize=(12, 4))
|