(self,mask,padding)
| 1363 | self.inpaint = Inpainting |
| 1364 | |
| 1365 | def pad_edge(self,mask,padding): |
| 1366 | #mask Tensor [H,W] |
| 1367 | mask = mask.numpy() |
| 1368 | true_indices = np.argwhere(mask) |
| 1369 | mask_array = np.zeros_like(mask, dtype=bool) |
| 1370 | for idx in true_indices: |
| 1371 | padded_slice = tuple(slice(max(0, i - padding), i + padding + 1) for i in idx) |
| 1372 | mask_array[padded_slice] = True |
| 1373 | new_mask = (mask_array * 255).astype(np.uint8) |
| 1374 | #new_mask |
| 1375 | return new_mask |
| 1376 | |
| 1377 | @prompts(name="Remove Something From The Photo", |
| 1378 | description="useful when you want to remove and object or something from the photo " |
no outgoing calls
no test coverage detected