Spaces:
Sleeping
Sleeping
esther commited on
Commit ·
8b1848e
1
Parent(s): 85aaa5b
test
Browse files- .gitignore +2 -1
- app.py +7 -6
.gitignore
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
# .gitignore
|
| 2 |
.DS_Store
|
| 3 |
/BIM_Dataset_V3
|
| 4 |
-
export_labels.py
|
|
|
|
|
|
| 1 |
# .gitignore
|
| 2 |
.DS_Store
|
| 3 |
/BIM_Dataset_V3
|
| 4 |
+
export_labels.py
|
| 5 |
+
recover_labels.py
|
app.py
CHANGED
|
@@ -50,19 +50,20 @@ def extract_hand_landmarks(frame):
|
|
| 50 |
features.extend([0.0] * 132) # Fill with zeros if no body seen
|
| 51 |
|
| 52 |
# 2. Extract RIGHT Hand - 21 landmarks * 3 values (x,y,z) = 63
|
| 53 |
-
|
| 54 |
-
|
|
|
|
| 55 |
features.extend([lm.x, lm.y, lm.z])
|
| 56 |
else:
|
| 57 |
features.extend([0.0] * 63)
|
| 58 |
|
| 59 |
-
# 3. Extract
|
| 60 |
-
if result.
|
| 61 |
-
for lm in result.
|
| 62 |
features.extend([lm.x, lm.y, lm.z])
|
| 63 |
else:
|
| 64 |
features.extend([0.0] * 63)
|
| 65 |
-
|
| 66 |
# The total should now be exactly 258!
|
| 67 |
return features
|
| 68 |
|
|
|
|
| 50 |
features.extend([0.0] * 132) # Fill with zeros if no body seen
|
| 51 |
|
| 52 |
# 2. Extract RIGHT Hand - 21 landmarks * 3 values (x,y,z) = 63
|
| 53 |
+
# 2. Extract LEFT Hand first (match training!)
|
| 54 |
+
if result.left_hand_landmarks:
|
| 55 |
+
for lm in result.left_hand_landmarks.landmark:
|
| 56 |
features.extend([lm.x, lm.y, lm.z])
|
| 57 |
else:
|
| 58 |
features.extend([0.0] * 63)
|
| 59 |
|
| 60 |
+
# 3. Extract RIGHT Hand second
|
| 61 |
+
if result.right_hand_landmarks:
|
| 62 |
+
for lm in result.right_hand_landmarks.landmark:
|
| 63 |
features.extend([lm.x, lm.y, lm.z])
|
| 64 |
else:
|
| 65 |
features.extend([0.0] * 63)
|
| 66 |
+
|
| 67 |
# The total should now be exactly 258!
|
| 68 |
return features
|
| 69 |
|