Skip to content
hky.u edited this page Jun 21, 2020 · 5 revisions

Usage with Example code

Example 1: Masking complete sets

import mask_clothes
model = mask_clothes.Model(img_size=512, threshold=0.7, gpu_count=1, images_per_gpu=1)
ROOT_DIR = 'Result/'

for x in range(1, 20):
    img, masked_image, label_type, label, score, complete = model.run(IMG_DIR='Images/mask' + str(x) + '.jpg')
    if complete is True:
        for y in range(len(label)):
            directory = ROOT_DIR + label_type[y] + '/' + str(x) + '_' + label[y] + '.jpeg'
            masked_image[y].save(directory)

ex1

Example 2: Displaying masked images

import mask_clothes
model = mask_clothes.Model(img_size=512, threshold=0.7, gpu_count=1, images_per_gpu=1)

img, masked_image, label_type, label, score, complete = model.run(IMG_DIR='Images/mask1.jpg')
for x in masked_image:
    x.show()

ex2

Clone this wiki locally