Spaces:
Sleeping
Sleeping
img_np fix
Browse files
app.py
CHANGED
|
@@ -60,6 +60,8 @@ def _process_saree_core(base_image: Image.Image, pattern_image: Image.Image, k:
|
|
| 60 |
|
| 61 |
# Prepare tensor
|
| 62 |
img_pil = base_image.convert("RGB")
|
|
|
|
|
|
|
| 63 |
img_resized = img_pil.resize((384, 384))
|
| 64 |
img_tensor = torch.from_numpy(np.array(img_resized)).permute(2, 0, 1).unsqueeze(0).float() / 255.0
|
| 65 |
mean = torch.as_tensor([0.5, 0.5, 0.5], device=img_tensor.device).view(1, 3, 1, 1)
|
|
|
|
| 60 |
|
| 61 |
# Prepare tensor
|
| 62 |
img_pil = base_image.convert("RGB")
|
| 63 |
+
img_np = np.array(img_pil)
|
| 64 |
+
|
| 65 |
img_resized = img_pil.resize((384, 384))
|
| 66 |
img_tensor = torch.from_numpy(np.array(img_resized)).permute(2, 0, 1).unsqueeze(0).float() / 255.0
|
| 67 |
mean = torch.as_tensor([0.5, 0.5, 0.5], device=img_tensor.device).view(1, 3, 1, 1)
|