sketchkit.cleanup.MasterSketch package

Submodules

sketchkit.cleanup.MasterSketch.MasterSketch module

class sketchkit.cleanup.MasterSketch.MasterSketch.MasterSketch(device: str = 'cuda')[source]

Bases: object

A class for rough sketch cleanup using the method of paper “Mastering Sketching: Adversarial Augmentation for Structured Prediction” in SIGGRAPH 2018.

device

The device that is used.

Type:

str

_download_models()[source]

Download the pretrained models

run(image_array: ndarray, image_folder: str = './', out_folder: str = 'cleanup') ndarray[source]

Sketch simplification for the input raster image.

Parameters:
  • image_array (numpy.ndarray) – input raster image in shape (H, W), with values in [0, 255].

  • image_folder (str, optional) – the folder of the input raster image.

  • out_folder (str, optional) – an output folder to store the output file.

Returns:

a sketch image in H*W in [0, 255].

Return type:

pred_out (numpy.ndimage)

Module contents

class sketchkit.cleanup.MasterSketch.MasterSketch(device: str = 'cuda')[source]

Bases: object

A class for rough sketch cleanup using the method of paper “Mastering Sketching: Adversarial Augmentation for Structured Prediction” in SIGGRAPH 2018.

device

The device that is used.

Type:

str

_download_models()[source]

Download the pretrained models

run(image_array: ndarray, image_folder: str = './', out_folder: str = 'cleanup') ndarray[source]

Sketch simplification for the input raster image.

Parameters:
  • image_array (numpy.ndarray) – input raster image in shape (H, W), with values in [0, 255].

  • image_folder (str, optional) – the folder of the input raster image.

  • out_folder (str, optional) – an output folder to store the output file.

Returns:

a sketch image in H*W in [0, 255].

Return type:

pred_out (numpy.ndimage)