コード例 #1
0
             scale_max=1.1,
             target_dist=0.6,
             interp=cv2.INTER_CUBIC),
    RotateAug(rotate_max_deg=40,
              interp=cv2.INTER_CUBIC,
              border=cv2.BORDER_CONSTANT,
              border_value=(128, 128, 128),
              mask_border_val=1),
    CropAug(368,
            368,
            center_perterb_max=40,
            border_value=(128, 128, 128),
            mask_border_val=1),

    # Todo: what does num_parts do?
    FlipAug(num_parts=18, prob=0.5),
]


def read_img(components):
    """
    Loads image from meta.img_path. Assigns the image to
    the field img of the same meta instance.

    :param components: components
    :return: updated components
    """
    meta = components[0]
    img_buf = open(meta.img_path, 'rb').read()

    if not img_buf:
コード例 #2
0
             target_dist=0.15,
             interp=cv2.INTER_CUBIC),
    RotateAug(rotate_max_deg=360,
              interp=cv2.INTER_CUBIC,
              border=cv2.BORDER_CONSTANT,
              border_value=(128, 128, 128),
              mask_border_val=1),
    CropAug(
        320,
        320,
        180,
        180,
        center_perterb_max=0,
        border_value=(128, 128, 128),  #40
        mask_border_val=1),
    FlipAug(num_parts=KEY_POINT_NUM - 1, prob=0.5),
]


def read_img(components):
    """
    Loads image from meta.img_path. Assigns the image to
    the field img of the same meta instance.

    :param components: components
    :return: updated components
    """
    meta = components[0]
    img_buf = open(meta.img_path, 'rb').read()

    if not img_buf: