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)
| 499 | |
| 500 | class BodyAlign(object): |
| 501 | def __init__(self, height, width, split_list_file, crop_prob=0, prefix='', aug_type=0, correction=False): |
| 502 | """ |
| 503 | split_info: path head, neck, waist, foot |
| 504 | bg_type: 0 stands for img_mean, 1 stands for black, 2 stands for mean of imagenet |
| 505 | """ |
| 506 | self.prefix = prefix |
| 507 | self.split_list_file = split_list_file |
| 508 | |
| 509 | # self.mean = [0.15714108, 0.27813716, 0.56472176] |
| 510 | # self.var = [0.00058989, 0.0009067, 0.00128566] |
| 511 | |
| 512 | self.aug_type = aug_type |
| 513 | self.crop_prob = crop_prob |
| 514 | self.imagenet_mean = [104, 116, 124] |
| 515 | self.height = height |
| 516 | self.width = width |
| 517 | # 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 |
| 518 | self.template_shape = (width, height) |
| 519 | |
| 520 | self.template_split_info = [0, 0.15625, 0.46875, 0.96875] # head, neck, waist, foot |
| 521 | self.template_point = np.array([ |
| 522 | [0, self.template_split_info[0]], [width, self.template_split_info[0]], |
| 523 | [0, self.template_split_info[1] * height], [width, self.template_split_info[1] * height], |
| 524 | [0, self.template_split_info[2] * height], [width, self.template_split_info[2] * height], |
| 525 | [0, self.template_split_info[3] * height], [width, self.template_split_info[3] * height] |
| 526 | ], dtype=np.float32) |
| 527 | |
| 528 | self._parse_split_info(correction=correction) |
| 529 | |
| 530 | print('[body align]correction:{}, height:{}, width:{}, aug_type {}, crop_prob:{}'. |
| 531 | format(correction, self.height, self.width, self.aug_type, self.crop_prob)) |
| 532 | |
| 533 | def _is_split_info_valid(self, head, neck, waist, foot): |
| 534 | if not head < 0.3: |
nothing calls this directly
no test coverage detected