MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / __init__

Method __init__

PATH/core/augmentation.py:805–835  ·  view source on GitHub ↗

split_info: path head, neck, waist, foot bg_type: 0 stands for img_mean, 1 stands for black, 2 stands for mean of imagenet

(self, height, width, split_list_file, crop_prob=0, prefix='', aug_type=0, correction=False)

Source from the content-addressed store, hash-verified

803
804class BodyAlign(object):
805 def __init__(self, height, width, split_list_file, crop_prob=0, prefix='', aug_type=0, correction=False):
806 """
807 split_info: path head, neck, waist, foot
808 bg_type: 0 stands for img_mean, 1 stands for black, 2 stands for mean of imagenet
809 """
810 self.prefix = prefix
811 self.split_list_file = split_list_file
812
813 # self.mean = [0.15714108, 0.27813716, 0.56472176]
814 # self.var = [0.00058989, 0.0009067, 0.00128566]
815
816 self.aug_type = aug_type
817 self.crop_prob = crop_prob
818 self.imagenet_mean = [104, 116, 124]
819 self.height = height
820 self.width = width
821 # template reference: aolai/indoor/aolai+20190218_10.254.250.96+video_2019_02_16_14_29.mov+221488+8+800_0_0_133_331_0.93.png 0.000000 0.156250 0.468750 0.968750
822 self.template_shape = (width, height)
823
824 self.template_split_info = [0, 0.15625, 0.46875, 0.96875] # head, neck, waist, foot
825 self.template_point = np.array([
826 [0, self.template_split_info[0]], [width, self.template_split_info[0]],
827 [0, self.template_split_info[1] * height], [width, self.template_split_info[1] * height],
828 [0, self.template_split_info[2] * height], [width, self.template_split_info[2] * height],
829 [0, self.template_split_info[3] * height], [width, self.template_split_info[3] * height]
830 ], dtype=np.float32)
831
832 self._parse_split_info(correction=correction)
833
834 print('[body align]correction:{}, height:{}, width:{}, aug_type {}, crop_prob:{}'.
835 format(correction, self.height, self.width, self.aug_type, self.crop_prob))
836
837 def _is_split_info_valid(self, head, neck, waist, foot):
838 if not head < 0.3:

Callers

nothing calls this directly

Calls 1

_parse_split_infoMethod · 0.95

Tested by

no test coverage detected