Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -272,7 +272,7 @@ class Session():
|
|
| 272 |
|
| 273 |
sesh = Session()
|
| 274 |
|
| 275 |
-
def submitPhoto(img):
|
| 276 |
sesh.current_img_signature = str(img.sum())
|
| 277 |
sesh.img_data[sesh.current_img_signature] = img
|
| 278 |
sesh.Palettes[sesh.current_img_signature] = {}
|
|
@@ -283,7 +283,9 @@ def submitPhoto(img):
|
|
| 283 |
sesh.Palette_img = np.zeros((200,200,3)).astype(np.uint8)
|
| 284 |
sesh.Palette_img[:] = 128
|
| 285 |
sesh.items_layouts[sesh.current_img_signature] = bed_layout_new
|
| 286 |
-
|
|
|
|
|
|
|
| 287 |
|
| 288 |
def summarisePerStore():
|
| 289 |
sesh.summary_joined = {}
|
|
@@ -2584,7 +2586,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), js=js_func) as demo:
|
|
| 2584 |
close4.click(closeSidePanel, None, [items_display, item_side, room_side, colors_side, merchant, replace, ads, store_summary])
|
| 2585 |
|
| 2586 |
|
| 2587 |
-
upload_photo.click(submitPhoto, upload, [choose_room, upload])
|
| 2588 |
choose_room.select(makePalettes, None, [color_Palettes, room2decorate, room_items])
|
| 2589 |
|
| 2590 |
#upload_photo.click(submitPhoto, upload, [working_room, upload])
|
|
|
|
| 272 |
|
| 273 |
sesh = Session()
|
| 274 |
|
| 275 |
+
def submitPhoto(img, rooms):
|
| 276 |
sesh.current_img_signature = str(img.sum())
|
| 277 |
sesh.img_data[sesh.current_img_signature] = img
|
| 278 |
sesh.Palettes[sesh.current_img_signature] = {}
|
|
|
|
| 283 |
sesh.Palette_img = np.zeros((200,200,3)).astype(np.uint8)
|
| 284 |
sesh.Palette_img[:] = 128
|
| 285 |
sesh.items_layouts[sesh.current_img_signature] = bed_layout_new
|
| 286 |
+
rooms.append((img, sesh.current_img_signature))
|
| 287 |
+
#return [(v,str(k)) for k,v in sesh.img_data.items()], gr.Image(label='Upload Room Photo
|
| 288 |
+
return rooms, gr.Image(label='Upload Room Photo')
|
| 289 |
|
| 290 |
def summarisePerStore():
|
| 291 |
sesh.summary_joined = {}
|
|
|
|
| 2586 |
close4.click(closeSidePanel, None, [items_display, item_side, room_side, colors_side, merchant, replace, ads, store_summary])
|
| 2587 |
|
| 2588 |
|
| 2589 |
+
upload_photo.click(submitPhoto, [upload, choose_room], [choose_room, upload])
|
| 2590 |
choose_room.select(makePalettes, None, [color_Palettes, room2decorate, room_items])
|
| 2591 |
|
| 2592 |
#upload_photo.click(submitPhoto, upload, [working_room, upload])
|