From c958f63931d127be121f302d8e4d51dc782d9cff Mon Sep 17 00:00:00 2001 From: RotemZilberman Date: Sat, 13 Jul 2024 00:17:44 +0300 Subject: [PATCH 1/2] fix right hand rendering --- synthetic_signwriting/generator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/synthetic_signwriting/generator.py b/synthetic_signwriting/generator.py index 1cbdcf6..91f0514 100644 --- a/synthetic_signwriting/generator.py +++ b/synthetic_signwriting/generator.py @@ -241,6 +241,9 @@ def render_fsw(self): generated_left_hand = str(hex(keyframe.left_hand_signwriting))[2:] generated_face = '2ff00' # TODO adding synthetic face option + # adding 8 offset to the left hand + generated_left_hand = str(hex(int(generated_left_hand, 16) + 0x8))[2:] + fsw += f"M538x552S{generated_face}482x483S{generated_right_hand}522x522S{generated_left_hand}455x521" return fsw From 3e6bba3b77476b17938dfd4a21af31d49b448741 Mon Sep 17 00:00:00 2001 From: RotemZilberman Date: Sat, 13 Jul 2024 01:56:41 +0300 Subject: [PATCH 2/2] changing the location of the mirroring of the left fsw sign --- synthetic_signwriting/generator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/synthetic_signwriting/generator.py b/synthetic_signwriting/generator.py index 91f0514..482b1c8 100644 --- a/synthetic_signwriting/generator.py +++ b/synthetic_signwriting/generator.py @@ -85,6 +85,8 @@ def _get_random_hand(self, is_right_hand=False, hand_index=None, hand_orientatio # Mirror right hand if is_right_hand: hand = hand * np.array([-1, 1, 1]) + else: + symbol += 0x8 return hand, symbol @@ -241,9 +243,6 @@ def render_fsw(self): generated_left_hand = str(hex(keyframe.left_hand_signwriting))[2:] generated_face = '2ff00' # TODO adding synthetic face option - # adding 8 offset to the left hand - generated_left_hand = str(hex(int(generated_left_hand, 16) + 0x8))[2:] - fsw += f"M538x552S{generated_face}482x483S{generated_right_hand}522x522S{generated_left_hand}455x521" return fsw