Update README.md
Browse files
README.md
CHANGED
|
@@ -54,10 +54,11 @@ model.requires_grad_(False).cuda().eval()
|
|
| 54 |
img0_path = r"_data\example_images\frame1.png"
|
| 55 |
img2_path = r"_data\example_images\frame3.png"
|
| 56 |
|
|
|
|
| 57 |
transforms = Compose([
|
| 58 |
Resize((256, 448)),
|
| 59 |
ToTensor(),
|
| 60 |
-
Normalize(mean=
|
| 61 |
])
|
| 62 |
|
| 63 |
img0 = transforms(Image.open(img0_path).convert("RGB")).unsqueeze(0).cuda()
|
|
@@ -68,10 +69,10 @@ img1 = model.reverse_process([img0, img2], tau)
|
|
| 68 |
|
| 69 |
plt.figure(figsize=(10, 5))
|
| 70 |
plt.subplot(1, 3, 1)
|
| 71 |
-
plt.imshow(denorm(img0, mean=
|
| 72 |
plt.subplot(1, 3, 2)
|
| 73 |
-
plt.imshow(denorm(img1, mean=
|
| 74 |
plt.subplot(1, 3, 3)
|
| 75 |
-
plt.imshow(denorm(img2, mean=
|
| 76 |
plt.show()
|
| 77 |
```
|
|
|
|
| 54 |
img0_path = r"_data\example_images\frame1.png"
|
| 55 |
img2_path = r"_data\example_images\frame3.png"
|
| 56 |
|
| 57 |
+
mean = std = [0.5]*3
|
| 58 |
transforms = Compose([
|
| 59 |
Resize((256, 448)),
|
| 60 |
ToTensor(),
|
| 61 |
+
Normalize(mean=mean, std=std),
|
| 62 |
])
|
| 63 |
|
| 64 |
img0 = transforms(Image.open(img0_path).convert("RGB")).unsqueeze(0).cuda()
|
|
|
|
| 69 |
|
| 70 |
plt.figure(figsize=(10, 5))
|
| 71 |
plt.subplot(1, 3, 1)
|
| 72 |
+
plt.imshow(denorm(img0, mean=mean, std=std).squeeze().permute(1, 2, 0).cpu().numpy())
|
| 73 |
plt.subplot(1, 3, 2)
|
| 74 |
+
plt.imshow(denorm(img1, mean=mean, std=std).squeeze().permute(1, 2, 0).cpu().numpy())
|
| 75 |
plt.subplot(1, 3, 3)
|
| 76 |
+
plt.imshow(denorm(img2, mean=mean, std=std).squeeze().permute(1, 2, 0).cpu().numpy())
|
| 77 |
plt.show()
|
| 78 |
```
|