def load_file(self): if not self.folder: # print(self.body_id) self.outline_file, self.img_file = get_file_name(self.body_id, 'F') else: self.outline_file, self.img_file = get_file_name( self.body_id, 'F', self.folder)
def save_bd_feature(name, folder): tags = ['F', 'S', 'B'] for tag in tags: _, pic_file = get_file_name(name, tag, folder) out_file = os.path.join(config.txt_dir, folder, '%s%s1.json' % (name, tag)) if os.path.exists(out_file): continue points, rect = body_client.body_points(pic_file) with open(out_file, 'w') as fp: json.dump(points, fp)
def save_outline(name, folder): tags = ['F', 'S', 'B'] for tag in tags: _, pic_file = get_file_name(name, tag, folder) out_file = os.path.join(config.txt_dir, folder, '%s%s2.txt' % (name, tag)) if os.path.exists(out_file): continue points, width, height = body_client.body_seg(pic_file) pts = [dict(x=p[0], y=p[1]) for p in points] points = dict(width=width, height=height, featureXY=pts) with open(out_file, 'w') as fp: json.dump(points, fp)
def load_file(self): if not self.folder: self.outline_file, self.img_file = get_file_name(self.body_id, 'B') else: self.outline_file, self.img_file = get_file_name( self.body_id, 'B', self.folder)