Safemotion Lib
Loading...
Searching...
No Matches
Functions | Variables
cvt_labelmap Namespace Reference

Functions

 cvt_labelmap_v21 (annotations, cvt_action_info, cvt_pose_info)
 
 cvt_labelmap_v21_pose_and_action (annotations, cvt_action_info, cvt_pose_info)
 
 cvt_labelmap_v22 (annotations)
 
 cvt_labelmap_v10_pkl (pkl_data, cvt_action_info)
 

Variables

dict labelmap_v10
 
dict labelmap_v20
 
list cvt_labelmap_v10_action_to_simple_ver
 
dict simple_lablemap
 
list cvt_labelmap_v21_action_to_simple_ver
 
list cvt_labelmap_v21_foot_to_simple_ver
 
list cvt_labelmap_v21_pose_to_simple_ver
 
dict simple_mutual_labelmap
 
dict mutual_action_lablemap
 
list cvt_labelmap_v21_action_to_simple_ver2
 
list cvt_labelmap_v21_pose_to_simple_ver2
 
dict simple_lablemap_action
 
dict simple_lablemap_pose
 
list cvt_labelmap_v22_action_upper
 
list simple_labelmap_v22_action_upper
 
list cvt_labelmap_v22_action_lower
 
list simple_labelmap_v22_action_lower
 
int pose_min_clip_range = 15
 
list cvt_labelmap_v22_action_pose
 
list simple_labelmap_v22_pose
 
list cvt_labelmap_v22_action_hand
 
list simple_labelmap_v22_hand
 
list cvt_labelmap_v22_action_foot
 
list simple_labelmap_v22_foot
 
list cvt_labelmap_v22_mutual_action
 
list simple_labelmap_v22_mutual_action
 

Function Documentation

◆ cvt_labelmap_v10_pkl()

cvt_labelmap.cvt_labelmap_v10_pkl ( pkl_data,
cvt_action_info )

Definition at line 599 of file cvt_labelmap.py.

599def cvt_labelmap_v10_pkl(pkl_data, cvt_action_info):
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]
604
605 ret_pkl[i]['label'] = new_action_id
606
607 return ret_pkl

◆ cvt_labelmap_v21()

cvt_labelmap.cvt_labelmap_v21 ( annotations,
cvt_action_info,
cvt_pose_info )

Definition at line 538 of file cvt_labelmap.py.

538def cvt_labelmap_v21(annotations, cvt_action_info, cvt_pose_info):
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]
543
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]
550
551 if anno['truncation'] > 2 or anno['occlusion'] > 2:
552 new_action_id = -1
553
554 ret_annotations[i]['action_id']['action'] = new_action_id
555
556 return ret_annotations
557

◆ cvt_labelmap_v21_pose_and_action()

cvt_labelmap.cvt_labelmap_v21_pose_and_action ( annotations,
cvt_action_info,
cvt_pose_info )

Definition at line 558 of file cvt_labelmap.py.

558def cvt_labelmap_v21_pose_and_action(annotations, cvt_action_info, cvt_pose_info):
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:
565 new_action_id = 0
566
567 new_pose_id = cvt_pose_info[pose_id][2]
568
569 ret_annotations[i]['action_id']['action'] = new_action_id
570 ret_annotations[i]['action_id']['pose'] = new_pose_id
571
572 return ret_annotations
573

◆ cvt_labelmap_v22()

cvt_labelmap.cvt_labelmap_v22 ( annotations)

Definition at line 574 of file cvt_labelmap.py.

574def cvt_labelmap_v22(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']
583
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]
589
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
595
596 return ret_annotations
597
598

Variable Documentation

◆ cvt_labelmap_v10_action_to_simple_ver

list cvt_labelmap.cvt_labelmap_v10_action_to_simple_ver
Initial value:
1= [
2 [0 , 'walk', 6],
3 [1 , 'stand', 4],
4 [2 , 'sit-Crouch', 2],
5 [3 , 'sit-sofa', 1],
6 [4 , 'sit-chair', 1],
7 [5 , 'sit-floor', 0],
8 [6 , 'falling-falling', 14],
9 [7 , 'lie', 9],
10 [8 , 'punch', 15],
11 [9 , 'kick', 16],
12 [10 , 'falling-fight', 14],
13]

Definition at line 84 of file cvt_labelmap.py.

◆ cvt_labelmap_v21_action_to_simple_ver

list cvt_labelmap.cvt_labelmap_v21_action_to_simple_ver

Definition at line 122 of file cvt_labelmap.py.

◆ cvt_labelmap_v21_action_to_simple_ver2

list cvt_labelmap.cvt_labelmap_v21_action_to_simple_ver2

Definition at line 257 of file cvt_labelmap.py.

◆ cvt_labelmap_v21_foot_to_simple_ver

list cvt_labelmap.cvt_labelmap_v21_foot_to_simple_ver
Initial value:
1= [
2 [0, "없음", None],
3 [1, "이동-느리게",6],
4 [2, "이동-빠르게",7],
5 [3, "이동-물건 위로",None],
6 [4, "이동-계단 오르기",None],
7 [5, "이동-계산 내려가기",None],
8]

Definition at line 185 of file cvt_labelmap.py.

◆ cvt_labelmap_v21_pose_to_simple_ver

list cvt_labelmap.cvt_labelmap_v21_pose_to_simple_ver
Initial value:
1= [
2 [0, "앉기-바닥", 0],
3 [1, "앉기-의자", 1],
4 [2, "앉기-무릎꿇기", 0],
5 [3, "앉기-무릎서기", 4],
6 [4, "앉기-쪼그리기", 2],
7 [5, "서있기", 4],
8 [6, "서있기-한발들기", 4],
9 [7, "서있기-무릎구부리기", 4],
10 [8, "서있기-허리구부리기", 5],
11 [9, "누워있기-천장보고", 9],
12 [10, "누워있기-엎드리기", 9],
13 [11, "누워있기-옆으로", 9],
14 [12, "누워있기-엎드려 머리들기", 9],
15 [13, "누워있기-구부리기", 9],
16 [14, "무릎기기 자세", 11]
17]

Definition at line 195 of file cvt_labelmap.py.

◆ cvt_labelmap_v21_pose_to_simple_ver2

list cvt_labelmap.cvt_labelmap_v21_pose_to_simple_ver2
Initial value:
1= [
2 [0, "앉기-바닥", 0],
3 [1, "앉기-의자", 0],
4 [2, "앉기-무릎꿇기", 0],
5 [3, "앉기-무릎서기", 1],
6 [4, "앉기-쪼그리기", 0],
7 [5, "서있기", 1],
8 [6, "서있기-한발들기", 1],
9 [7, "서있기-무릎구부리기", 1],
10 [8, "서있기-허리구부리기", 1],
11 [9, "누워있기-천장보고", 2],
12 [10, "누워있기-엎드리기", 2],
13 [11, "누워있기-옆으로", 2],
14 [12, "누워있기-엎드려 머리들기", 2],
15 [13, "누워있기-구부리기", 2],
16 [14, "무릎기기 자세", 3]
17]

Definition at line 319 of file cvt_labelmap.py.

◆ cvt_labelmap_v22_action_foot

list cvt_labelmap.cvt_labelmap_v22_action_foot
Initial value:
1= [
2 [0, "없음", 0, pose_min_clip_range, False],
3 [1, "다리꼬기", 1, pose_min_clip_range, False],
4 [2, "기타", -1, pose_min_clip_range, False],
5]

Definition at line 490 of file cvt_labelmap.py.

◆ cvt_labelmap_v22_action_hand

list cvt_labelmap.cvt_labelmap_v22_action_hand
Initial value:
1= [
2 [0, "없음", 0, pose_min_clip_range, False],
3 [1, "팔짱끼기", 1, pose_min_clip_range, False],
4 [2, "가리키기", 2, pose_min_clip_range, False],
5 [3, "기타", -1, pose_min_clip_range, False],
6 [4, "양팔들기", 3, pose_min_clip_range, False],
7]

Definition at line 475 of file cvt_labelmap.py.

◆ cvt_labelmap_v22_action_lower

list cvt_labelmap.cvt_labelmap_v22_action_lower
Initial value:
1= [
2 [0, "없음", 0, 0, False],
3 [1, "앉기", 1, 0, True],
4 [2, "일어서기", 2, 0, True],
5 [3, "서성이기", 3, 50, True],
6 [4, "걷기", 4, 50, True],
7 [5, "달리기", 5, 15, True], #
8 [6, "기어가기", 6, 20, True], #
9 [7, "점프-제자리", 7, 0, True], #
10 [8, "넘어짐", 8, 0, True],
11 [9, "떨어짐", -1, 0, True],
12 [10, "킥", 9, 0, True], #
13 [11, "턴", 10, 0, True],
14 [12, "점프-두발", 11, 0, True], #
15 [13, "기타", -1, 0, False], #
16]

Definition at line 381 of file cvt_labelmap.py.

◆ cvt_labelmap_v22_action_pose

list cvt_labelmap.cvt_labelmap_v22_action_pose
Initial value:
1= [
2 [0, "앉기-바닥", 0, pose_min_clip_range, False],
3 [1, "앉기-의자", 1, pose_min_clip_range, False],
4 [2, "앉기-무릎꿇기", 2, pose_min_clip_range, False],
5 [3, "앉기-무릎서기", 3, pose_min_clip_range, False],
6 [4, "앉기-쪼그리기", -1, pose_min_clip_range, False],
7 [5, "서있기", 4, pose_min_clip_range, False],
8 [6, "서있기-한발들기", 4, pose_min_clip_range, False],
9 [7, "서있기-허리구부리기", 5, pose_min_clip_range, False],
10 [8, "스쿼트-허리세우기", -1, pose_min_clip_range, False],
11 [9, "스쿼트-허리구부리기", -1, pose_min_clip_range, False],
12 [10, "누워있기-천장보고", 6, pose_min_clip_range, False],
13 [11, "누워있기-엎드리기", 6, pose_min_clip_range, False],
14 [12, "누워있기-옆으로", 6, pose_min_clip_range, False],
15 [13, "무릎기기 자세", 7, pose_min_clip_range, False],
16 [14, "앉기-한쪽무릎굽히기", -1, pose_min_clip_range, False],
17 [15, "식별불가", -1, pose_min_clip_range, False]
18]

Definition at line 445 of file cvt_labelmap.py.

◆ cvt_labelmap_v22_action_upper

list cvt_labelmap.cvt_labelmap_v22_action_upper
Initial value:
1= [
2 #idx, name, cvt_label, min_clip_len, use_margin, check_train_frame
3 [0, "없음", 0, 0, False],
4 [1, "허리 구부리기", 1, 0, True],
5 [2, "허리 펴기", 2, 0, True],
6 [3, "먹기", -1, 0, True],
7 [4, "펀치", 3, 0, True],
8 [5, "휘두르기", -1, 0, True],
9 [6, "손흔들기", 4, 0, True],
10 [7, "가리키기", 5, 0, True],
11 [8, "밀치기", 3, 0, True],
12 [9, "끼적이기", -1, 0, True],
13 [10, "기타", -1, 0, True],
14]

Definition at line 357 of file cvt_labelmap.py.

◆ cvt_labelmap_v22_mutual_action

list cvt_labelmap.cvt_labelmap_v22_mutual_action
Initial value:
1= [
2 [0, "없음", 0],
3 [1, "안겨있기", 1],
4 [2, "안고있기", 2],
5 [3, "영유아를 들어서 이동", 3],
6 [4, "옷(기저귀) 갈아입히기", -1],
7 [5, "쓰다듬기", 4],
8 [6, "토닥이기", 5],
9 [7, "머리따주기", -1],
10 [8, "먹여주기", 6],
11 [9, "물건 건네주기", -1],
12 [10, "물건 받기", -1],
13 [11, "장난감 빼앗기", -1],
14 [12, "손으로 때리기", -1],
15 [13, "물건으로 때리기", -1],
16 [14, "발로 때리기", -1],
17 [15, "신체 밀치기", 7],
18 [16, "신체 당기기", 8],
19 [17, "친구와 부딪힘", -1],
20 [18, "할퀴기", -1],
21 [19, "물기", -1],
22 [20, "매달리기", -1],
23 [21, "안고있기-토닥이기", -1]
24]

Definition at line 501 of file cvt_labelmap.py.

◆ labelmap_v10

dict cvt_labelmap.labelmap_v10
Initial value:
1= {
2 0 : 'walk',
3 1 : 'stand',
4 2 : 'sit-Crouch',
5 3 : 'sit-sofa',
6 4 : 'sit-chair',
7 5 : 'sit-floor',
8 6 : 'falling-falling',
9 7 : 'lie',
10 8 : 'punch',
11 9 : 'kick',
12 10 : 'falling-fight',
13 11 : 'plunging',
14 12 : 'sit',
15 13 : 'falling'
16}

Definition at line 4 of file cvt_labelmap.py.

◆ labelmap_v20

dict cvt_labelmap.labelmap_v20

Definition at line 22 of file cvt_labelmap.py.

◆ mutual_action_lablemap

dict cvt_labelmap.mutual_action_lablemap
Initial value:
1= {
2 0 : "None",
3 1 : "안겨있기", #
4 2 : "안고있기", #
5 3 : "영유아를 들어서 이동", #
6 4 : "옷(기저귀) 갈아입히기", #
7 5 : "쓰다듬기", #
8 6 : "토닥이기", #
9 7 : "머리따주기",
10 8 : "먹여주기", #
11 9 : "물건 건네주기", #
12 10 : "물건 받기", #
13 11 : "장난감 빼앗기",
14 12 : "손으로 때리기",
15 13 : "물건으로 때리기",
16 14 : "발로 때리기",
17 15 : "신체 밀치기", #
18 16 : "신체 당기기", #
19 17 : "친구와 부딪힘",
20 18 : "할퀴기",
21 19 : "물기"
22}

Definition at line 233 of file cvt_labelmap.py.

◆ pose_min_clip_range

int cvt_labelmap.pose_min_clip_range = 15

Definition at line 444 of file cvt_labelmap.py.

◆ simple_labelmap_v22_action_lower

list cvt_labelmap.simple_labelmap_v22_action_lower
Initial value:
1= [
2 [0, "없음"],
3 [1, "앉기"],
4 [2, "일어서기"],
5 [3, "서성이기"],
6 [4, "걷기"],
7 [5, "달리기"],
8 [6, "기어가기"],
9 [7, "점프-제자리"],
10 [8, "넘어짐"],
11 [9, "킥"],
12 [10, "턴"],
13 [11, "점프-두발"],
14]

Definition at line 398 of file cvt_labelmap.py.

◆ simple_labelmap_v22_action_upper

list cvt_labelmap.simple_labelmap_v22_action_upper
Initial value:
1= [
2 [0, "없음"],
3 [1, "허리 구부리기"],
4 [2, "허리 펴기"],
5 [3, "펀치"],
6 [4, "손흔들기"],
7 [5, "가리키기"]
8]

Definition at line 372 of file cvt_labelmap.py.

◆ simple_labelmap_v22_foot

list cvt_labelmap.simple_labelmap_v22_foot
Initial value:
1= [
2 [0, "없음"],
3 [1, "다리꼬기"],
4]

Definition at line 496 of file cvt_labelmap.py.

◆ simple_labelmap_v22_hand

list cvt_labelmap.simple_labelmap_v22_hand
Initial value:
1= [
2 [0, "없음"],
3 [1, "팔짱끼기"],
4 [2, "가리키기"],
5 [3, "양팔들기"],
6]

Definition at line 483 of file cvt_labelmap.py.

◆ simple_labelmap_v22_mutual_action

list cvt_labelmap.simple_labelmap_v22_mutual_action
Initial value:
1= [
2 [0, "없음", 0, False],
3 [1, "안겨있기", 50, False],
4 [2, "안고있기", 40, False],
5 [3, "영유아를 들어서 이동", 0, False],
6 [4, "쓰다듬기", 40, False],
7 [5, "토닥이기", 10, True],
8 [6, "먹여주기", 40, False],
9 [7, "신체 밀치기", 10, True],
10 [8, "신체 당기기", 50, False]
11]

Definition at line 526 of file cvt_labelmap.py.

◆ simple_labelmap_v22_pose

list cvt_labelmap.simple_labelmap_v22_pose
Initial value:
1= [
2 [0, "앉기"],
3 [1, "앉기-의자"],
4 [2, "앉기-무릎꿇기"],
5 [3, "앉기-무릎서기"],
6 [4, "서있기"],
7 [5, "서있기-허리구부리기"],
8 [6, "누워있기"],
9 [7, "무릎기기 자세"],
10]

Definition at line 464 of file cvt_labelmap.py.

◆ simple_lablemap

dict cvt_labelmap.simple_lablemap
Initial value:
1= {
2 0 : "sit",#"앉기",
3 1 : "sit_chair",
4 2 : "sit_squat",
5 3 : "sit_move", #앉은상태로 이동
6 4 : "standing",#"서있기",
7 5 : "bend_over",#허리숙이기
8 6 : "walk",#"걷기",
9 7 : "run",#"뛰기",
10 #8 : "run_galloping", #갤로핑
11 8 : "stand",#"일어서기",
12 9 : "lying",#"누워있기",
13 10 : "crawl",#"기어가기",
14 11 : "crawl_pose",#"기어가기 자세",
15 12 : "jump",#"점프",
16 13 : "eating",#"먹기",
17 14 : "fall-down",#"넘어짐", "떨어짐"
18 15 : "punch", #"펀치"
19 16 : "kick", #"발차기",
20 #18 : "scrawl", #"끼적이기"
21}

Definition at line 99 of file cvt_labelmap.py.

◆ simple_lablemap_action

dict cvt_labelmap.simple_lablemap_action
Initial value:
1= {
2 0 : "None",
3 1 : "walk",
4 2 : "run",
5 3 : "crawl",
6 4 : "jump",
7 5 : "eat",
8 6 : "fall-down",
9 7 : "punch",
10 8 : "kick",
11}

Definition at line 337 of file cvt_labelmap.py.

◆ simple_lablemap_pose

dict cvt_labelmap.simple_lablemap_pose
Initial value:
1= {
2 0 : "sit",
3 1 : "standing",
4 2 : "lying",
5 3 : "crawl_pose"
6}

Definition at line 349 of file cvt_labelmap.py.

◆ simple_mutual_labelmap

dict cvt_labelmap.simple_mutual_labelmap
Initial value:
1= {
2 0 : "None",
3 1 : "안기",
4 2 : "옷 갈아입히기(서서)",
5 3 : "옷 갈아입히기(눕혀서)",
6 4 : "쓰다듬기",
7 5 : "토닥이기",
8 6 : "머리따주기",
9 7 : "먹여주기",
10 8 : "물건 전달",
11 9 : "밀기",
12 10 : "당기기",
13 11 : "부딪힘",
14 12 : "손으로 때리기",
15 13 : "발로 때리기",
16 14 : "물기"
17}

Definition at line 214 of file cvt_labelmap.py.