Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -625,7 +625,9 @@ def updateItemDisplay(seshid, budget=False):
|
|
| 625 |
r = requests.post(url, data=json.dumps(valid_data), headers=headers)
|
| 626 |
jsondata = json.loads(r.content)
|
| 627 |
scores = jsondata['data']
|
| 628 |
-
section_scores = [
|
|
|
|
|
|
|
| 629 |
end = time.time()
|
| 630 |
|
| 631 |
print('updateDisplay -- item images downloaded: ', str(end-start), section_scores, item_idxs)
|
|
|
|
| 625 |
r = requests.post(url, data=json.dumps(valid_data), headers=headers)
|
| 626 |
jsondata = json.loads(r.content)
|
| 627 |
scores = jsondata['data']
|
| 628 |
+
section_scores = [scores[sum(item_lens_ln[:i]):sum(item_lens_ln[:i])+ln] for i,ln in enumerate(item_lens_ln)]
|
| 629 |
+
section_scores_amax = [np.argmax(s) if s else -1 for s in section_scores]
|
| 630 |
+
best_idxs = [item_idxs[i][idx] if idx > -1 else -1 for i,idx in enumerate(section_scores_amax)]
|
| 631 |
end = time.time()
|
| 632 |
|
| 633 |
print('updateDisplay -- item images downloaded: ', str(end-start), section_scores, item_idxs)
|