File size: 466 Bytes
0f90f73
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
from skimage import io
from skimage.transform import resize

from saicinpainting.evaluation.masks.mask import SegmentationMask

im = io.imread('imgs/ex4.jpg')
im = resize(im, (512, 1024), anti_aliasing=True)
mask_seg = SegmentationMask(num_variants_per_mask=10)
mask_examples = mask_seg.get_masks(im)
for i, example in enumerate(mask_examples):
    plt.imshow(example)
    plt.show()
    plt.imsave(f'tmp/img_masks/{i}.png', example)