|
Safemotion Lib
|
Functions | |
| make_pose_result (anno_data) | |
Variables | |
| list | sys_path = ['/workspace/smlab', '/workspace'] |
| action_vis_param | |
| vis_param | |
| str | action_cfg_path = '/workspace/InnoTest/models/posec3d_action.py' |
| str | posture_cfg_path = '/workspace/InnoTest/models/posec3d_pose.py' |
| str | image_base = '/media/safemotion/HDD2/SM_Dataset/action_2022/action_cctv_img/images' |
| str | save_root = '/media/safemotion/HDD5/pjm_test/inno2023_result_select_half' |
| list | anno_folder_list |
| list | cvt_lower_map = [0, 1, 2, 0, 4, 5, 6, 7, 8, 9, 0, 11] |
| list | cvt_upper_map = [0, 0, 0, 3, 4, 0] |
| list | cvt_pose_map = [0, 0, 0, 0, 4, 4, 6, 7] |
| list | cvt_hand_map = [0, 0, 0, 3] |
| str | device = 'cuda:0' |
| action_model = smrunner.build_model(action_cfg_path).to(device) | |
| posture_model = smrunner.build_model(posture_cfg_path).to(device) | |
| labelmap = dict() | |
| list | json_path_list = [] |
| name_list | |
| path_list | |
| NUM = len(json_path_list) | |
| int | video_fps = 30 |
| int | action_k = video_fps*2 |
| int | action_sample = 20 |
| int | pose_k = video_fps//2 |
| int | pose_sample = 6 |
| data_manager = AnnotationDataManager() | |
| json_name = json_path.split('/')[-1] | |
| save_folder = os.path.join(save_root, json_name.split('.')[0]) | |
| save_video_path = os.path.join(save_root, json_name.replace('.json', '.mp4')) | |
| json_path | |
| dict | track_data = {} |
| int | frame_id = 0 |
| end | |
| anno_data = data_manager.get_anno_data_in_image(filter=True) | |
| image = data_manager.read_image() | |
| vis_img = image.copy() | |
| pose_result = make_pose_result(anno_data) | |
| track_id = int(pose['track_id']) | |
| list | delete_list = [] |
| int | txt_pos_y = 50 |
| bbox = pose_q[-1]['bbox'] | |
| last_frame = pose_q[-1]['frame_id'] | |
| str | label = f'{track_id:3d}' |
| action_result = action_model.run_recognizer(pose_q, action_k, action_sample, device=device) | |
| posture_result = posture_model.run_recognizer(pose_q[-pose_k:], pose_k, pose_sample, False, device=device) | |
| list | pose_label = cvt_pose_map[posture_result['pred_pose']] |
| list | upper_label = cvt_upper_map[action_result['pred_action_upper']] |
| list | lower_label = cvt_lower_map[action_result['pred_action_lower']] |
| list | hand_label = cvt_hand_map[posture_result['pred_hand']] |
| str | name = f'{frame_id:06d}.jpg' |
| save_path = os.path.join(save_folder, name) | |
| fps | |
| half | |
| action_demo_with_anno.make_pose_result | ( | anno_data | ) |
Definition at line 26 of file action_demo_with_anno.py.
| str action_demo_with_anno.action_cfg_path = '/workspace/InnoTest/models/posec3d_action.py' |
Definition at line 60 of file action_demo_with_anno.py.
| int action_demo_with_anno.action_k = video_fps*2 |
Definition at line 110 of file action_demo_with_anno.py.
| action_demo_with_anno.action_model = smrunner.build_model(action_cfg_path).to(device) |
Definition at line 88 of file action_demo_with_anno.py.
| action_demo_with_anno.action_result = action_model.run_recognizer(pose_q, action_k, action_sample, device=device) |
Definition at line 185 of file action_demo_with_anno.py.
| int action_demo_with_anno.action_sample = 20 |
Definition at line 111 of file action_demo_with_anno.py.
| action_demo_with_anno.action_vis_param |
Definition at line 41 of file action_demo_with_anno.py.
| action_demo_with_anno.anno_data = data_manager.get_anno_data_in_image(filter=True) |
Definition at line 139 of file action_demo_with_anno.py.
| list action_demo_with_anno.anno_folder_list |
Definition at line 66 of file action_demo_with_anno.py.
| action_demo_with_anno.bbox = pose_q[-1]['bbox'] |
Definition at line 166 of file action_demo_with_anno.py.
| list action_demo_with_anno.cvt_hand_map = [0, 0, 0, 3] |
Definition at line 81 of file action_demo_with_anno.py.
| list action_demo_with_anno.cvt_lower_map = [0, 1, 2, 0, 4, 5, 6, 7, 8, 9, 0, 11] |
Definition at line 78 of file action_demo_with_anno.py.
| list action_demo_with_anno.cvt_pose_map = [0, 0, 0, 0, 4, 4, 6, 7] |
Definition at line 80 of file action_demo_with_anno.py.
| list action_demo_with_anno.cvt_upper_map = [0, 0, 0, 3, 4, 0] |
Definition at line 79 of file action_demo_with_anno.py.
| action_demo_with_anno.data_manager = AnnotationDataManager() |
Definition at line 116 of file action_demo_with_anno.py.
| list action_demo_with_anno.delete_list = [] |
Definition at line 162 of file action_demo_with_anno.py.
| str action_demo_with_anno.device = 'cuda:0' |
Definition at line 87 of file action_demo_with_anno.py.
| action_demo_with_anno.end |
Definition at line 136 of file action_demo_with_anno.py.
| action_demo_with_anno.fps |
Definition at line 240 of file action_demo_with_anno.py.
| int action_demo_with_anno.frame_id = 0 |
Definition at line 133 of file action_demo_with_anno.py.
| action_demo_with_anno.half |
Definition at line 240 of file action_demo_with_anno.py.
| list action_demo_with_anno.hand_label = cvt_hand_map[posture_result['pred_hand']] |
Definition at line 202 of file action_demo_with_anno.py.
| action_demo_with_anno.image = data_manager.read_image() |
Definition at line 142 of file action_demo_with_anno.py.
| action_demo_with_anno.image_base = '/media/safemotion/HDD2/SM_Dataset/action_2022/action_cctv_img/images' |
Definition at line 62 of file action_demo_with_anno.py.
| action_demo_with_anno.json_name = json_path.split('/')[-1] |
Definition at line 122 of file action_demo_with_anno.py.
| action_demo_with_anno.json_path |
Definition at line 128 of file action_demo_with_anno.py.
| list action_demo_with_anno.json_path_list = [] |
Definition at line 101 of file action_demo_with_anno.py.
| str action_demo_with_anno.label = f'{track_id:3d}' |
Definition at line 170 of file action_demo_with_anno.py.
| action_demo_with_anno.labelmap = dict() |
Definition at line 94 of file action_demo_with_anno.py.
| action_demo_with_anno.last_frame = pose_q[-1]['frame_id'] |
Definition at line 168 of file action_demo_with_anno.py.
| list action_demo_with_anno.lower_label = cvt_lower_map[action_result['pred_action_lower']] |
Definition at line 201 of file action_demo_with_anno.py.
| str action_demo_with_anno.name = f'{frame_id:06d}.jpg' |
Definition at line 235 of file action_demo_with_anno.py.
| action_demo_with_anno.name_list |
Definition at line 103 of file action_demo_with_anno.py.
| action_demo_with_anno.NUM = len(json_path_list) |
Definition at line 105 of file action_demo_with_anno.py.
| action_demo_with_anno.path_list |
Definition at line 103 of file action_demo_with_anno.py.
| int action_demo_with_anno.pose_k = video_fps//2 |
Definition at line 112 of file action_demo_with_anno.py.
| list action_demo_with_anno.pose_label = cvt_pose_map[posture_result['pred_pose']] |
Definition at line 199 of file action_demo_with_anno.py.
| action_demo_with_anno.pose_result = make_pose_result(anno_data) |
Definition at line 149 of file action_demo_with_anno.py.
| int action_demo_with_anno.pose_sample = 6 |
Definition at line 113 of file action_demo_with_anno.py.
| str action_demo_with_anno.posture_cfg_path = '/workspace/InnoTest/models/posec3d_pose.py' |
Definition at line 61 of file action_demo_with_anno.py.
| action_demo_with_anno.posture_model = smrunner.build_model(posture_cfg_path).to(device) |
Definition at line 89 of file action_demo_with_anno.py.
| action_demo_with_anno.posture_result = posture_model.run_recognizer(pose_q[-pose_k:], pose_k, pose_sample, False, device=device) |
Definition at line 191 of file action_demo_with_anno.py.
| action_demo_with_anno.save_folder = os.path.join(save_root, json_name.split('.')[0]) |
Definition at line 123 of file action_demo_with_anno.py.
| action_demo_with_anno.save_path = os.path.join(save_folder, name) |
Definition at line 236 of file action_demo_with_anno.py.
| str action_demo_with_anno.save_root = '/media/safemotion/HDD5/pjm_test/inno2023_result_select_half' |
Definition at line 63 of file action_demo_with_anno.py.
| action_demo_with_anno.save_video_path = os.path.join(save_root, json_name.replace('.json', '.mp4')) |
Definition at line 124 of file action_demo_with_anno.py.
| list action_demo_with_anno.sys_path = ['/workspace/smlab', '/workspace'] |
Definition at line 4 of file action_demo_with_anno.py.
| dict action_demo_with_anno.track_data = {} |
Definition at line 132 of file action_demo_with_anno.py.
| action_demo_with_anno.track_id = int(pose['track_id']) |
Definition at line 153 of file action_demo_with_anno.py.
| int action_demo_with_anno.txt_pos_y = 50 |
Definition at line 163 of file action_demo_with_anno.py.
| list action_demo_with_anno.upper_label = cvt_upper_map[action_result['pred_action_upper']] |
Definition at line 200 of file action_demo_with_anno.py.
| action_demo_with_anno.video_fps = 30 |
Definition at line 109 of file action_demo_with_anno.py.
| action_demo_with_anno.vis_img = image.copy() |
Definition at line 145 of file action_demo_with_anno.py.
| action_demo_with_anno.vis_param |
Definition at line 50 of file action_demo_with_anno.py.