Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -615,10 +615,10 @@ def updateItemDisplay(seshid, budget=False):
|
|
| 615 |
urls = [sesh.item_data[sesh.current_img_signature][sesh.room_type][sesh.room_style][sesh.price][sesh.Palette_ids[sesh.current_img_signature]][pair[0]][idx]['img'] for i,pair in enumerate(item_idxs) if pair[1] for idx in pair[1]]
|
| 616 |
start = time.time()
|
| 617 |
responses = asyncio.run(main(urls))
|
| 618 |
-
|
| 619 |
|
| 620 |
url = 'https://dreamdemo.pythonanywhere.com/rgb'
|
| 621 |
-
valid_data = {'rgbs':
|
| 622 |
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
| 623 |
r = requests.post(url, data=json.dumps(valid_data), headers=headers)
|
| 624 |
jsondata = json.loads(r.content)
|
|
|
|
| 615 |
urls = [sesh.item_data[sesh.current_img_signature][sesh.room_type][sesh.room_style][sesh.price][sesh.Palette_ids[sesh.current_img_signature]][pair[0]][idx]['img'] for i,pair in enumerate(item_idxs) if pair[1] for idx in pair[1]]
|
| 616 |
start = time.time()
|
| 617 |
responses = asyncio.run(main(urls))
|
| 618 |
+
rgbs = [getMostUsedColorsRGB(r) for r in responses]
|
| 619 |
|
| 620 |
url = 'https://dreamdemo.pythonanywhere.com/rgb'
|
| 621 |
+
valid_data = {'rgbs':rgbs}
|
| 622 |
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
|
| 623 |
r = requests.post(url, data=json.dumps(valid_data), headers=headers)
|
| 624 |
jsondata = json.loads(r.content)
|