MCPcopy Index your code
hub / github.com/HiLab-git/WORD / scribble4class

Function scribble4class

scribbles_generator.py:233–245  ·  view source on GitHub ↗
(label, class_id, class_num, iteration=[4, 10], cut_branch=True)

Source from the content-addressed store, hash-verified

231
232
233def scribble4class(label, class_id, class_num, iteration=[4, 10], cut_branch=True):
234 label = (label == class_id)
235 sk_map = scrible_2d(label, iteration=iteration)
236 if cut_branch and class_id != 0:
237 cut = Cutting_branch()
238 for i in range(sk_map.shape[0]):
239 lab = sk_map[i]
240 if lab.sum() < 1:
241 continue
242 sk_map[i] = cut(lab, seg_lab=label[i])
243 if class_id == 0:
244 class_id = class_num
245 return sk_map * class_id
246
247
248def generate_scribble(label, iterations, cut_branch=True):

Callers 1

generate_scribbleFunction · 0.85

Calls 2

scrible_2dFunction · 0.85
Cutting_branchClass · 0.85

Tested by

no test coverage detected