(label, iterations, cut_branch=True)
| 246 | |
| 247 | |
| 248 | def generate_scribble(label, iterations, cut_branch=True): |
| 249 | class_num = np.max(label) + 1 |
| 250 | output = np.zeros_like(label, dtype=np.uint8) |
| 251 | for i in range(class_num): |
| 252 | it = iterations[i] if isinstance(iterations, list) else iterations |
| 253 | scribble = scribble4class( |
| 254 | label, i, class_num, it, cut_branch=cut_branch) |
| 255 | output += scribble.astype(np.uint8) |
| 256 | return output |
| 257 | |
| 258 | |
| 259 | if __name__ == "__main__": |
no test coverage detected