wsiprocess.converters

wsiprocess.converters.wsiprocess_to_coco

Converter to COCO style.

wsiprocess_to_coco is convert helper which convert the wsiprocess output for COCO object detection format. Only available for “detection” method, but works when extracting patches and after extraction.

class wsiprocess.converters.wsiprocess_to_coco.ToCOCOConverter(params=False)

Converter class.

add_categories(annotation, cls)
annotations_to_json()
convert()
get_annotation_params(annotation, classes, file_name, slidestem, x, y, width, height, image_id, annotation_id)
get_image_params(file_name, slidestem, x, y, width, height, image_id)
get_ratio()
get_save_as()
getargs()
make_dirs()
make_output()
read_last_data()
save_data()

wsiprocess.converters.wsiprocess_to_voc

Converter to VOC style.

wsiprocess_to_voc is convert helper which convert the wsiprocess output for VOC object detection format. Only available for “detection” method, but works when extracting patches and after extraction.

class wsiprocess.converters.wsiprocess_to_voc.ToVOCConverter(params=False)

Converter class.

convert()
getargs()
make_tree()
makedirs()
mkdirs(subdirectory)
move_to_test()

If ratio has only two parameters like “8:2”, trainval.txt and test.txt would be generated. If ratio has 3 params like “8:1:1”, trainval.txt, val.txt and text.txt would be generated.

read_result_file()
to_jpg(src, dst)
class wsiprocess.converters.wsiprocess_to_voc.VOCTree(root, save_to, result, patch_width, patch_height)
add_base_text()
add_main_branches()
add_objects()
add_sub_branches()
add_text(branch, text)
make_template()
set_size()
to_xml()

wsiprocess.converters.wsiprocess_to_yolo

Converter to YOLO style.

wsiprocess_to_yolo is convert helper which convert the wsiprocess output for YOLO object detection format. Only available for “detection” method, but works when extracting patches and after extraction.

class wsiprocess.converters.wsiprocess_to_yolo.ToYOLOConverter(params=False)
convert()
get_image_paths()
getargs()
make_images()
make_labels()
make_paths()

If ratio has only two parameters like “8:2”, trainval.txt and test.txt would be generated. If ratio has 3 params like “8:1:1”, trainval.txt, val.txt and text.txt would be generated.

makedirs()
parse_ratio()
read_result_file()
rename_path(path)