11 6 :
'falling-falling',
84cvt_labelmap_v10_action_to_simple_ver=[
87 [2 ,
'sit-Crouch', 2],
91 [6 ,
'falling-falling', 14],
95 [10 ,
'falling-fight', 14],
122cvt_labelmap_v21_action_to_simple_ver=[
134 [11,
"뛰기-갤로핑",
None],
135 [12,
"뛰기-게걸음",
None],
139 [16,
"눕기-업드려 머리들기",9],
143 [20,
"기어가기-무릎기기", 10],
144 [21,
"기어가기-배밀이",
None],
145 [22,
"기어가기-계단기기", 10],
153 [30,
"안기-안겨있기",
None],
154 [31,
"안기-안고있기",
None],
158 [35,
"먹기-받아먹기",
None],
162 [39,
"부딪힘-사람",
None],
166 [43,
"물건 던지기",
None],
168 [45,
"물건으로 때리기", 15],
170 [47,
"양팔제압하기",
None],
173 [50,
"옷(기저귀) 갈아입기",
None],
176 [53,
"머리 따주기",
None],
177 [54,
"영유아를 들어서 옮기기",
None],
178 [55,
"물건 건네주기",
None],
185cvt_labelmap_v21_foot_to_simple_ver=[
189 [3,
"이동-물건 위로",
None],
190 [4,
"이동-계단 오르기",
None],
191 [5,
"이동-계산 내려가기",
None],
195cvt_labelmap_v21_pose_to_simple_ver=[
203 [7,
"서있기-무릎구부리기", 4],
204 [8,
"서있기-허리구부리기", 5],
206 [10,
"누워있기-엎드리기", 9],
208 [12,
"누워있기-엎드려 머리들기", 9],
209 [13,
"누워있기-구부리기", 9],
214simple_mutual_labelmap={
233mutual_action_lablemap={
257cvt_labelmap_v21_action_to_simple_ver2=[
269 [11,
"뛰기-갤로핑",
None],
270 [12,
"뛰기-게걸음",
None],
271 [13,
"일어서기-스스로",
None],
272 [14,
"일어서기-짚고",
None],
274 [16,
"눕기-업드려 머리들기",
None],
275 [17,
"뒤집기-시도",
None],
276 [18,
"뒤집기-성공",
None],
277 [19,
"뒤집기-굴러가기",
None],
278 [20,
"기어가기-무릎기기", 3],
279 [21,
"기어가기-배밀이",
None],
280 [22,
"기어가기-계단기기", 3],
288 [30,
"안기-안겨있기",
None],
289 [31,
"안기-안고있기",
None],
293 [35,
"먹기-받아먹기",
None],
297 [39,
"부딪힘-사람",
None],
301 [43,
"물건 던지기",
None],
305 [47,
"양팔제압하기",
None],
308 [50,
"옷(기저귀) 갈아입기",
None],
311 [53,
"머리 따주기",
None],
312 [54,
"영유아를 들어서 옮기기",
None],
313 [55,
"물건 건네주기",
None],
319cvt_labelmap_v21_pose_to_simple_ver2=[
327 [7,
"서있기-무릎구부리기", 1],
328 [8,
"서있기-허리구부리기", 1],
330 [10,
"누워있기-엎드리기", 2],
332 [12,
"누워있기-엎드려 머리들기", 2],
333 [13,
"누워있기-구부리기", 2],
337simple_lablemap_action={
349simple_lablemap_pose={
357cvt_labelmap_v22_action_upper=[
359 [0,
"없음", 0, 0,
False],
360 [1,
"허리 구부리기", 1, 0,
True],
361 [2,
"허리 펴기", 2, 0,
True],
362 [3,
"먹기", -1, 0,
True],
363 [4,
"펀치", 3, 0,
True],
364 [5,
"휘두르기", -1, 0,
True],
365 [6,
"손흔들기", 4, 0,
True],
366 [7,
"가리키기", 5, 0,
True],
367 [8,
"밀치기", 3, 0,
True],
368 [9,
"끼적이기", -1, 0,
True],
369 [10,
"기타", -1, 0,
True],
372simple_labelmap_v22_action_upper = [
381cvt_labelmap_v22_action_lower=[
382 [0,
"없음", 0, 0,
False],
383 [1,
"앉기", 1, 0,
True],
384 [2,
"일어서기", 2, 0,
True],
385 [3,
"서성이기", 3, 50,
True],
386 [4,
"걷기", 4, 50,
True],
387 [5,
"달리기", 5, 15,
True],
388 [6,
"기어가기", 6, 20,
True],
389 [7,
"점프-제자리", 7, 0,
True],
390 [8,
"넘어짐", 8, 0,
True],
391 [9,
"떨어짐", -1, 0,
True],
392 [10,
"킥", 9, 0,
True],
393 [11,
"턴", 10, 0,
True],
394 [12,
"점프-두발", 11, 0,
True],
395 [13,
"기타", -1, 0,
False],
398simple_labelmap_v22_action_lower = [
444pose_min_clip_range = 15
445cvt_labelmap_v22_action_pose=[
446 [0,
"앉기-바닥", 0, pose_min_clip_range,
False],
447 [1,
"앉기-의자", 1, pose_min_clip_range,
False],
448 [2,
"앉기-무릎꿇기", 2, pose_min_clip_range,
False],
449 [3,
"앉기-무릎서기", 3, pose_min_clip_range,
False],
450 [4,
"앉기-쪼그리기", -1, pose_min_clip_range,
False],
451 [5,
"서있기", 4, pose_min_clip_range,
False],
452 [6,
"서있기-한발들기", 4, pose_min_clip_range,
False],
453 [7,
"서있기-허리구부리기", 5, pose_min_clip_range,
False],
454 [8,
"스쿼트-허리세우기", -1, pose_min_clip_range,
False],
455 [9,
"스쿼트-허리구부리기", -1, pose_min_clip_range,
False],
456 [10,
"누워있기-천장보고", 6, pose_min_clip_range,
False],
457 [11,
"누워있기-엎드리기", 6, pose_min_clip_range,
False],
458 [12,
"누워있기-옆으로", 6, pose_min_clip_range,
False],
459 [13,
"무릎기기 자세", 7, pose_min_clip_range,
False],
460 [14,
"앉기-한쪽무릎굽히기", -1, pose_min_clip_range,
False],
461 [15,
"식별불가", -1, pose_min_clip_range,
False]
464simple_labelmap_v22_pose = [
475cvt_labelmap_v22_action_hand=[
476 [0,
"없음", 0, pose_min_clip_range,
False],
477 [1,
"팔짱끼기", 1, pose_min_clip_range,
False],
478 [2,
"가리키기", 2, pose_min_clip_range,
False],
479 [3,
"기타", -1, pose_min_clip_range,
False],
480 [4,
"양팔들기", 3, pose_min_clip_range,
False],
483simple_labelmap_v22_hand = [
490cvt_labelmap_v22_action_foot=[
491 [0,
"없음", 0, pose_min_clip_range,
False],
492 [1,
"다리꼬기", 1, pose_min_clip_range,
False],
493 [2,
"기타", -1, pose_min_clip_range,
False],
496simple_labelmap_v22_foot = [
501cvt_labelmap_v22_mutual_action=[
505 [3,
"영유아를 들어서 이동", 3],
506 [4,
"옷(기저귀) 갈아입히기", -1],
515 [13,
"물건으로 때리기", -1],
523 [21,
"안고있기-토닥이기", -1]
526simple_labelmap_v22_mutual_action = [
528 [1,
"안겨있기", 50,
False],
529 [2,
"안고있기", 40,
False],
530 [3,
"영유아를 들어서 이동", 0,
False],
531 [4,
"쓰다듬기", 40,
False],
532 [5,
"토닥이기", 10,
True],
533 [6,
"먹여주기", 40,
False],
534 [7,
"신체 밀치기", 10,
True],
535 [8,
"신체 당기기", 50,
False]
539 ret_annotations = copy.deepcopy(annotations)
540 for i, anno
in enumerate(annotations):
541 action_id = anno[
'action_id'][
'action']
542 new_action_id = cvt_action_info[action_id][2]
544 if action_id == 11
or action_id == 12:
545 move_id = anno[
'action_id'][
'foot']
546 new_action_id = cvt_labelmap_v21_foot_to_simple_ver[move_id][2]
547 elif new_action_id
is None:
548 pose_id = anno[
'action_id'][
'pose']
549 new_action_id = cvt_pose_info[pose_id][2]
551 if anno[
'truncation'] > 2
or anno[
'occlusion'] > 2:
554 ret_annotations[i][
'action_id'][
'action'] = new_action_id
556 return ret_annotations
559 ret_annotations = copy.deepcopy(annotations)
560 for i, anno
in enumerate(annotations):
561 action_id = anno[
'action_id'][
'action']
562 pose_id = anno[
'action_id'][
'pose']
563 new_action_id = cvt_action_info[action_id][2]
564 if new_action_id
is None:
567 new_pose_id = cvt_pose_info[pose_id][2]
569 ret_annotations[i][
'action_id'][
'action'] = new_action_id
570 ret_annotations[i][
'action_id'][
'pose'] = new_pose_id
572 return ret_annotations
575 ret_annotations = copy.deepcopy(annotations)
576 for i, anno
in enumerate(annotations):
577 action_id = anno[
'action_id']
578 upper = action_id[
'action_upper']
579 lower = action_id[
'action_lower']
580 pose = action_id[
'pose']
581 hand = action_id[
'hand']
582 foot = action_id[
'foot']
584 new_upper = cvt_labelmap_v22_action_upper[upper][2]
585 new_lower = cvt_labelmap_v22_action_lower[lower][2]
586 new_pose = cvt_labelmap_v22_action_pose[pose][2]
587 new_hand = cvt_labelmap_v22_action_hand[hand][2]
588 new_foot = cvt_labelmap_v22_action_foot[foot][2]
590 ret_annotations[i][
'action_id'][
'action_upper'] = new_upper
591 ret_annotations[i][
'action_id'][
'action_lower'] = new_lower
592 ret_annotations[i][
'action_id'][
'pose'] = new_pose
593 ret_annotations[i][
'action_id'][
'hand'] = new_hand
594 ret_annotations[i][
'action_id'][
'foot'] = new_foot
596 return ret_annotations
600 ret_pkl = copy.deepcopy(pkl_data)
601 for i, anno
in enumerate(pkl_data):
602 action_id = anno[
'label']
603 new_action_id = cvt_action_info[action_id][2]
605 ret_pkl[i][
'label'] = new_action_id
cvt_labelmap_v21_pose_and_action(annotations, cvt_action_info, cvt_pose_info)
cvt_labelmap_v21(annotations, cvt_action_info, cvt_pose_info)
cvt_labelmap_v22(annotations)
cvt_labelmap_v10_pkl(pkl_data, cvt_action_info)