Spaces:
Sleeping
Sleeping
Update
Browse files
app.py
CHANGED
|
@@ -11,18 +11,34 @@ def get_attributes(json):
|
|
| 11 |
gender = attr.get('gender')
|
| 12 |
emotion = attr.get('emotion')
|
| 13 |
ethnicity = attr.get('ethnicity')
|
| 14 |
-
|
|
|
|
| 15 |
if attr.get('glasses') == 'USUAL':
|
| 16 |
-
|
| 17 |
else if attr.get('glasses') == 'DARK':
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
eye = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
facehair = attr.get('facial_hair')
|
| 22 |
haircolor = attr.get('hair_color')
|
| 23 |
hairtype = attr.get('hair_type')
|
| 24 |
headwear = attr.get('headwear')
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
pitch = attr.get('pitch')
|
| 27 |
roll = attr.get('roll')
|
| 28 |
yaw = attr.get('yaw')
|
|
|
|
| 11 |
gender = attr.get('gender')
|
| 12 |
emotion = attr.get('emotion')
|
| 13 |
ethnicity = attr.get('ethnicity')
|
| 14 |
+
|
| 15 |
+
mask = [attr.get('face_mask')]
|
| 16 |
if attr.get('glasses') == 'USUAL':
|
| 17 |
+
mask.append('GLASSES')
|
| 18 |
else if attr.get('glasses') == 'DARK':
|
| 19 |
+
mask.append('SUNGLASSES')
|
| 20 |
+
|
| 21 |
+
eye = []
|
| 22 |
+
if attr.get('eye_left') >= 0.5:
|
| 23 |
+
eye.append('LEFT')
|
| 24 |
+
if attr.get('eye_right') >= 0.5:
|
| 25 |
+
eye.append('RIGHT')
|
| 26 |
+
|
| 27 |
facehair = attr.get('facial_hair')
|
| 28 |
haircolor = attr.get('hair_color')
|
| 29 |
hairtype = attr.get('hair_type')
|
| 30 |
headwear = attr.get('headwear')
|
| 31 |
+
|
| 32 |
+
activity = []
|
| 33 |
+
if attr.get('phone_recording') >= 0.5:
|
| 34 |
+
activaty.append('PHONE_RECORDING')
|
| 35 |
+
if attr.get('phone_use') >= 0.5:
|
| 36 |
+
activaty.append('PHONE_USE')
|
| 37 |
+
if attr.get('seatbelt') >= 0.5:
|
| 38 |
+
activaty.append('SEATBELT')
|
| 39 |
+
if attr.get('smoking') >= 0.5:
|
| 40 |
+
activaty.append('SMOKING')
|
| 41 |
+
|
| 42 |
pitch = attr.get('pitch')
|
| 43 |
roll = attr.get('roll')
|
| 44 |
yaw = attr.get('yaw')
|