def extract_img(root: str,
                cur_dir: str,
                out_dir: str,
                mode: str = 'train',
                file_type: str = 'img') -> None:
    """_summary_

    Args:
       Args:
        root (str): root where the extracted data is saved
        cur_dir (cur_dir): dir where the zip_file exists
        out_dir (str): root dir where the data is saved

        mode (str, optional): Defaults to 'train'.
        file_type (str, optional): Defaults to 'img',else to 'mask'.
    """
    zip_file = zipfile.ZipFile(cur_dir)
    zip_file.extractall(root)
    for cur_dir, dirs, files in os.walk(root):
        # filter child dirs and directories with "Illustration" and "MACOSX"
        if len(dirs) == 0 and \
                cur_dir.split('\\')[-1].find('Illustration') == -1 and \
                cur_dir.find('MACOSX') == -1:

            file_names = [
                file for file in files
                if file.endswith('.jpg') or file.endswith('.bmp')
            ]
            for filename in sorted(file_names):
                img = mmcv.imread(osp.join(cur_dir, filename))

                if file_type == 'annotations':
                    img = img[:, :, 0]
                    img[np.where(img == 0)] = 1
                    img[np.where(img == 128)] = 2
                    img[np.where(img == 255)] = 0
                mmcv.imwrite(
                    img,
                    osp.join(out_dir, file_type, mode,
                             osp.splitext(filename)[0] + '.png'))
_summary_

    Args:
       Args:
        root (str): root where the extracted data is saved
        cur_dir (cur_dir): dir where the zip_file exists
        out_dir (str): root dir where the data is saved

        mode (str, optional): Defaults to 'train'.
        file_type (str, optional): Defaults to 'img',else to 'mask'.
    
segmentation/tools/dataset_converters/refuge.py