|
Safemotion Lib
|
Variables | |
| list | sys_path = ['/workspace/smlab', '/workspace'] |
| str | det_cfg_path = '/workspace/smlab/smdetect/configs/yolo/yolov8.py' |
| str | track_cfg_path = '/workspace/smlab/smtrack/configs/bytetrack/bytetrack_base.py' |
| str | pose_cfg_path = '/workspace/smlab/smpose/configs/mmpose/hrnet_trt.py' |
| str | action_cfg_path = '/workspace/InnoTest/models/posec3d_action.py' |
| str | posture_cfg_path = '/workspace/InnoTest/models/posec3d_pose.py' |
| str | device = 'cuda:0' |
| det_model = smrunner.build_model(det_cfg_path) | |
| track_model = smrunner.build_model(track_cfg_path) | |
| pose_model = smrunner.build_model(pose_cfg_path) | |
| action_model = smrunner.build_model(action_cfg_path).to(device) | |
| posture_model = smrunner.build_model(posture_cfg_path).to(device) | |
| int | action_sample = 20 |
| int | pose_sample = 6 |
| labelmap = dict() | |
| list | cvt_lower_map = [0, 1, 2, 0, 4, 5, 0, 7, 8, 9, 0, 11] |
| list | cvt_upper_map = [0, 0, 0, 3, 0, 0] |
| list | cvt_pose_map = [0, 0, 0, 0, 4, 4, 6, 0] |
| list | cvt_hand_map = [0, 0, 0, 3] |
| action_vis_param | |
| vis_param | |
| str | video_folder = '/media/safemotion/HDD5/pjm_test/ai_park_test_video' |
| _ | |
| video_path_list | |
| str | save_folder = '/media/safemotion/HDD5/pjm_test/ai_park_test_fps20' |
| str | tmp_save_folder = '/media/safemotion/HDD5/pjm_test/tmp_clip_images_fps20' |
| video_name = video_path.split('/')[-1] | |
| save_video_path = os.path.join(save_folder, video_name) | |
| cap = cv2.VideoCapture(video_path) | |
| total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) | |
| fps = cap.get(cv2.CAP_PROP_FPS) | |
| int | action_k = int(fps+0.5)*2 |
| int | pose_k = int(fps+0.5)//2 |
| dict | track_data = {} |
| int | frame_id = 0 |
| ret | |
| image | |
| end | |
| img_shape = image.shape[:2] | |
| vis_img = image.copy() | |
| det_result = det_model.run_detector(image) | |
| track_result = track_model.run_tracker(det_result['det_bboxes'], det_result['det_labels'], frame_id) | |
| pose_result = pose_model.run_detector(image, track_result['track_bboxes'][0]) | |
| 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:09d}.jpg' |
| save_path = os.path.join(tmp_save_folder, name) | |
| half | |
|
protected |
Definition at line 76 of file action_demo_with_video.py.
| str action_demo_with_video.action_cfg_path = '/workspace/InnoTest/models/posec3d_action.py' |
Definition at line 24 of file action_demo_with_video.py.
| int action_demo_with_video.action_k = int(fps+0.5)*2 |
Definition at line 110 of file action_demo_with_video.py.
| action_demo_with_video.action_model = smrunner.build_model(action_cfg_path).to(device) |
Definition at line 32 of file action_demo_with_video.py.
| action_demo_with_video.action_result = action_model.run_recognizer(pose_q, action_k, action_sample, device=device) |
Definition at line 172 of file action_demo_with_video.py.
| int action_demo_with_video.action_sample = 20 |
Definition at line 39 of file action_demo_with_video.py.
| action_demo_with_video.action_vis_param |
Definition at line 56 of file action_demo_with_video.py.
| action_demo_with_video.bbox = pose_q[-1]['bbox'] |
Definition at line 153 of file action_demo_with_video.py.
| action_demo_with_video.cap = cv2.VideoCapture(video_path) |
Definition at line 98 of file action_demo_with_video.py.
| list action_demo_with_video.cvt_hand_map = [0, 0, 0, 3] |
Definition at line 53 of file action_demo_with_video.py.
| list action_demo_with_video.cvt_lower_map = [0, 1, 2, 0, 4, 5, 0, 7, 8, 9, 0, 11] |
Definition at line 50 of file action_demo_with_video.py.
| list action_demo_with_video.cvt_pose_map = [0, 0, 0, 0, 4, 4, 6, 0] |
Definition at line 52 of file action_demo_with_video.py.
| list action_demo_with_video.cvt_upper_map = [0, 0, 0, 3, 0, 0] |
Definition at line 51 of file action_demo_with_video.py.
| list action_demo_with_video.delete_list = [] |
Definition at line 149 of file action_demo_with_video.py.
| str action_demo_with_video.det_cfg_path = '/workspace/smlab/smdetect/configs/yolo/yolov8.py' |
Definition at line 21 of file action_demo_with_video.py.
| action_demo_with_video.det_model = smrunner.build_model(det_cfg_path) |
Definition at line 29 of file action_demo_with_video.py.
| action_demo_with_video.det_result = det_model.run_detector(image) |
Definition at line 134 of file action_demo_with_video.py.
| str action_demo_with_video.device = 'cuda:0' |
Definition at line 28 of file action_demo_with_video.py.
| action_demo_with_video.end |
Definition at line 127 of file action_demo_with_video.py.
| action_demo_with_video.fps = cap.get(cv2.CAP_PROP_FPS) |
Definition at line 106 of file action_demo_with_video.py.
| int action_demo_with_video.frame_id = 0 |
Definition at line 115 of file action_demo_with_video.py.
| action_demo_with_video.half |
Definition at line 221 of file action_demo_with_video.py.
| list action_demo_with_video.hand_label = cvt_hand_map[posture_result['pred_hand']] |
Definition at line 190 of file action_demo_with_video.py.
| action_demo_with_video.image |
Definition at line 119 of file action_demo_with_video.py.
| action_demo_with_video.img_shape = image.shape[:2] |
Definition at line 128 of file action_demo_with_video.py.
| str action_demo_with_video.label = f'{track_id:3d}' |
Definition at line 157 of file action_demo_with_video.py.
| action_demo_with_video.labelmap = dict() |
Definition at line 43 of file action_demo_with_video.py.
| action_demo_with_video.last_frame = pose_q[-1]['frame_id'] |
Definition at line 155 of file action_demo_with_video.py.
| list action_demo_with_video.lower_label = cvt_lower_map[action_result['pred_action_lower']] |
Definition at line 189 of file action_demo_with_video.py.
| str action_demo_with_video.name = f'{frame_id:09d}.jpg' |
Definition at line 216 of file action_demo_with_video.py.
| str action_demo_with_video.pose_cfg_path = '/workspace/smlab/smpose/configs/mmpose/hrnet_trt.py' |
Definition at line 23 of file action_demo_with_video.py.
| int action_demo_with_video.pose_k = int(fps+0.5)//2 |
Definition at line 111 of file action_demo_with_video.py.
| list action_demo_with_video.pose_label = cvt_pose_map[posture_result['pred_pose']] |
Definition at line 187 of file action_demo_with_video.py.
| action_demo_with_video.pose_model = smrunner.build_model(pose_cfg_path) |
Definition at line 31 of file action_demo_with_video.py.
| action_demo_with_video.pose_result = pose_model.run_detector(image, track_result['track_bboxes'][0]) |
Definition at line 136 of file action_demo_with_video.py.
| int action_demo_with_video.pose_sample = 6 |
Definition at line 40 of file action_demo_with_video.py.
| str action_demo_with_video.posture_cfg_path = '/workspace/InnoTest/models/posec3d_pose.py' |
Definition at line 25 of file action_demo_with_video.py.
| action_demo_with_video.posture_model = smrunner.build_model(posture_cfg_path).to(device) |
Definition at line 33 of file action_demo_with_video.py.
| action_demo_with_video.posture_result = posture_model.run_recognizer(pose_q[-pose_k:], pose_k, pose_sample, False, device=device) |
Definition at line 179 of file action_demo_with_video.py.
| action_demo_with_video.ret |
Definition at line 119 of file action_demo_with_video.py.
| str action_demo_with_video.save_folder = '/media/safemotion/HDD5/pjm_test/ai_park_test_fps20' |
Definition at line 79 of file action_demo_with_video.py.
| action_demo_with_video.save_path = os.path.join(tmp_save_folder, name) |
Definition at line 217 of file action_demo_with_video.py.
| action_demo_with_video.save_video_path = os.path.join(save_folder, video_name) |
Definition at line 95 of file action_demo_with_video.py.
| list action_demo_with_video.sys_path = ['/workspace/smlab', '/workspace'] |
Definition at line 3 of file action_demo_with_video.py.
| action_demo_with_video.tmp_save_folder = '/media/safemotion/HDD5/pjm_test/tmp_clip_images_fps20' |
Definition at line 83 of file action_demo_with_video.py.
| action_demo_with_video.total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) |
Definition at line 105 of file action_demo_with_video.py.
| str action_demo_with_video.track_cfg_path = '/workspace/smlab/smtrack/configs/bytetrack/bytetrack_base.py' |
Definition at line 22 of file action_demo_with_video.py.
| dict action_demo_with_video.track_data = {} |
Definition at line 114 of file action_demo_with_video.py.
| action_demo_with_video.track_id = int(pose['track_id']) |
Definition at line 140 of file action_demo_with_video.py.
| action_demo_with_video.track_model = smrunner.build_model(track_cfg_path) |
Definition at line 30 of file action_demo_with_video.py.
| action_demo_with_video.track_result = track_model.run_tracker(det_result['det_bboxes'], det_result['det_labels'], frame_id) |
Definition at line 135 of file action_demo_with_video.py.
| int action_demo_with_video.txt_pos_y = 50 |
Definition at line 150 of file action_demo_with_video.py.
| list action_demo_with_video.upper_label = cvt_upper_map[action_result['pred_action_upper']] |
Definition at line 188 of file action_demo_with_video.py.
| str action_demo_with_video.video_folder = '/media/safemotion/HDD5/pjm_test/ai_park_test_video' |
Definition at line 75 of file action_demo_with_video.py.
| action_demo_with_video.video_name = video_path.split('/')[-1] |
Definition at line 94 of file action_demo_with_video.py.
| action_demo_with_video.video_path_list |
Definition at line 76 of file action_demo_with_video.py.
| action_demo_with_video.vis_img = image.copy() |
Definition at line 131 of file action_demo_with_video.py.
| action_demo_with_video.vis_param |
Definition at line 65 of file action_demo_with_video.py.