Spaces:
Running
on
Zero
Running
on
Zero
Update pipeline_minimax_remover.py
Browse files
pipeline_minimax_remover.py
CHANGED
|
@@ -121,8 +121,6 @@ class Minimax_Remover_Pipeline(DiffusionPipeline):
|
|
| 121 |
output_type: Optional[str] = "np",
|
| 122 |
iterations: int = 16
|
| 123 |
):
|
| 124 |
-
|
| 125 |
-
print(f"images.shape: {images.shape}, masks.shape:{masks.shape}")
|
| 126 |
self._current_timestep = None
|
| 127 |
self._interrupt = False
|
| 128 |
device = self._execution_device
|
|
@@ -147,11 +145,16 @@ class Minimax_Remover_Pipeline(DiffusionPipeline):
|
|
| 147 |
latents,
|
| 148 |
)
|
| 149 |
|
|
|
|
| 150 |
masks = self.expand_masks(masks, iterations)
|
|
|
|
| 151 |
masks = self.resize(masks, height, width).to("cuda:0").half()
|
|
|
|
| 152 |
masks[masks>0] = 1
|
| 153 |
images = rearrange(images, "f h w c -> c f h w")
|
|
|
|
| 154 |
images = self.resize(images[None,...], height, width).to("cuda:0").half()
|
|
|
|
| 155 |
|
| 156 |
masked_images = images * (1-masks)
|
| 157 |
|
|
|
|
| 121 |
output_type: Optional[str] = "np",
|
| 122 |
iterations: int = 16
|
| 123 |
):
|
|
|
|
|
|
|
| 124 |
self._current_timestep = None
|
| 125 |
self._interrupt = False
|
| 126 |
device = self._execution_device
|
|
|
|
| 145 |
latents,
|
| 146 |
)
|
| 147 |
|
| 148 |
+
print(f"1 images.shape: {images.shape}, masks.shape:{masks.shape}")
|
| 149 |
masks = self.expand_masks(masks, iterations)
|
| 150 |
+
print(f"2 images.shape: {images.shape}, masks.shape:{masks.shape}")
|
| 151 |
masks = self.resize(masks, height, width).to("cuda:0").half()
|
| 152 |
+
print(f"3 images.shape: {images.shape}, masks.shape:{masks.shape}")
|
| 153 |
masks[masks>0] = 1
|
| 154 |
images = rearrange(images, "f h w c -> c f h w")
|
| 155 |
+
print(f"4 images.shape: {images.shape}, masks.shape:{masks.shape}")
|
| 156 |
images = self.resize(images[None,...], height, width).to("cuda:0").half()
|
| 157 |
+
print(f"5 images.shape: {images.shape}, masks.shape:{masks.shape}")
|
| 158 |
|
| 159 |
masked_images = images * (1-masks)
|
| 160 |
|