MCPcopy Create free account
hub / github.com/SystemErrorWang/White-box-Cartoonization / simple_superpixel

Function simple_superpixel

train_code/utils.py:109–120  ·  view source on GitHub ↗
(batch_image, seg_num=200)

Source from the content-addressed store, hash-verified

107
108
109def simple_superpixel(batch_image, seg_num=200):
110
111 def process_slic(image):
112 seg_label = segmentation.slic(image, n_segments=seg_num, sigma=1,
113 compactness=10, convert2lab=True)
114 image = color.label2rgb(seg_label, image, kind='mix')
115 return image
116
117 num_job = np.shape(batch_image)[0]
118 batch_out = Parallel(n_jobs=num_job)(delayed(process_slic)\
119 (image) for image in batch_image)
120 return np.array(batch_out)
121
122
123

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected