hagenw commited on
Commit
8e2ced3
·
1 Parent(s): 360a832

Simplify returned labels

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -87,12 +87,12 @@ def process_func(x: np.ndarray, sampling_rate: int) -> dict:
87
  y = y.detach().cpu().numpy()
88
 
89
  # convert to dict
90
- y = [
91
- {"score": 100 * y[0][0], "label": "age"},
92
- {"score": y[0][1], "label": "female"},
93
- {"score": y[0][2], "label": "male"},
94
- {"score": y[0][3], "label": "child"},
95
- ]
96
 
97
  return y
98
 
 
87
  y = y.detach().cpu().numpy()
88
 
89
  # convert to dict
90
+ y = {
91
+ "age": 100 * y[0][0],
92
+ "female": y[0][1],
93
+ "male": y[0][2],
94
+ "child": y[0][3],
95
+ }
96
 
97
  return y
98