Update app.py
Browse files
app.py
CHANGED
|
@@ -212,6 +212,8 @@ class Session():
|
|
| 212 |
self.time = ''
|
| 213 |
self.reset = False
|
| 214 |
self.locator_genid = {}
|
|
|
|
|
|
|
| 215 |
|
| 216 |
class AllSessions():
|
| 217 |
def __init__(self):
|
|
@@ -251,6 +253,8 @@ def submitPhoto(img, rooms, seshid):
|
|
| 251 |
sesh.filtered_files[sesh.current_img_signature] = {}
|
| 252 |
sesh.filtered_files_room[sesh.current_img_signature] = {}
|
| 253 |
sesh.filtered_files_style[sesh.current_img_signature] = {}
|
|
|
|
|
|
|
| 254 |
sesh.Palette_img = np.zeros((200,200,3)).astype(np.uint8)
|
| 255 |
sesh.Palette_img[:] = 128
|
| 256 |
sesh.items_layouts[sesh.current_img_signature] = bed_layout_new
|
|
@@ -595,11 +599,11 @@ def updateItemDisplay(seshid, budget=False, pallete_change=False):
|
|
| 595 |
for i,_ in enumerate(formats):
|
| 596 |
np.random.shuffle(idxs[i])
|
| 597 |
idxs[i] = idxs[i][:number_of_items[i]]
|
| 598 |
-
frmt_idxs_maps[formats[i]] = [item_locator_data[i][idx] for idx in idxs[i]]
|
| 599 |
-
frmt_id_maps[formats[i]] = str(time.time())
|
| 600 |
time.sleep(.001)
|
| 601 |
#json_data = [json.dumps({'video_format': fmt, 'number_of_items': number_of_items[i], 'room_type': sesh.room_type, 'item_locator_data': item_locator_data, 'gen_uid': i, 'responses':responses, 'items': items}) for i,fmt in enumerate(formats)]
|
| 602 |
-
json_data = [json.dumps({'video_format': fmt, 'number_of_items': number_of_items[i], 'idxs':idxs[i][:number_of_items[i]], 'room_type': sesh.room_type, 'item_locator_data': item_locator_data[i], 'gen_uid': frmt_id_maps[formats[i]], 'seshid':seshid, 'items': items[i]}) for i,fmt in enumerate(formats)]
|
| 603 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=.5))
|
| 604 |
#responses = asyncio.run(main_post(urls, headers, json_data, timeout=3))
|
| 605 |
print('*-/*/-*-updateDisplay: dumped scriptgen_promise: ', responses)
|
|
|
|
| 212 |
self.time = ''
|
| 213 |
self.reset = False
|
| 214 |
self.locator_genid = {}
|
| 215 |
+
self.frmt_idxs_maps = {}
|
| 216 |
+
self.frmt_id_maps = {}
|
| 217 |
|
| 218 |
class AllSessions():
|
| 219 |
def __init__(self):
|
|
|
|
| 253 |
sesh.filtered_files[sesh.current_img_signature] = {}
|
| 254 |
sesh.filtered_files_room[sesh.current_img_signature] = {}
|
| 255 |
sesh.filtered_files_style[sesh.current_img_signature] = {}
|
| 256 |
+
sesh.frmt_idxs_maps[sesh.current_img_signature] = {}
|
| 257 |
+
sesh.frmt_id_maps[sesh.current_img_signature] = {}
|
| 258 |
sesh.Palette_img = np.zeros((200,200,3)).astype(np.uint8)
|
| 259 |
sesh.Palette_img[:] = 128
|
| 260 |
sesh.items_layouts[sesh.current_img_signature] = bed_layout_new
|
|
|
|
| 599 |
for i,_ in enumerate(formats):
|
| 600 |
np.random.shuffle(idxs[i])
|
| 601 |
idxs[i] = idxs[i][:number_of_items[i]]
|
| 602 |
+
sesh.frmt_idxs_maps[sesh.current_img_signature][formats[i]] = [item_locator_data[i][idx] for idx in idxs[i]]
|
| 603 |
+
sesh.frmt_id_maps[sesh.current_img_signature][formats[i]] = str(time.time())
|
| 604 |
time.sleep(.001)
|
| 605 |
#json_data = [json.dumps({'video_format': fmt, 'number_of_items': number_of_items[i], 'room_type': sesh.room_type, 'item_locator_data': item_locator_data, 'gen_uid': i, 'responses':responses, 'items': items}) for i,fmt in enumerate(formats)]
|
| 606 |
+
json_data = [json.dumps({'video_format': fmt, 'number_of_items': number_of_items[i], 'idxs':idxs[i][:number_of_items[i]], 'room_type': sesh.room_type, 'item_locator_data': item_locator_data[i], 'gen_uid': sesh.frmt_id_maps[sesh.current_img_signature][formats[i]], 'seshid':seshid, 'items': items[i]}) for i,fmt in enumerate(formats)]
|
| 607 |
responses = asyncio.run(main_post(urls, headers, json_data, timeout=.5))
|
| 608 |
#responses = asyncio.run(main_post(urls, headers, json_data, timeout=3))
|
| 609 |
print('*-/*/-*-updateDisplay: dumped scriptgen_promise: ', responses)
|