Sijuade commited on
Commit
49d0ebc
1 Parent(s): 9d52a0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py CHANGED
@@ -54,6 +54,14 @@ def casa_ai_run_tab3(dict=None):
54
 
55
  return results
56
 
 
 
 
 
 
 
 
 
57
  with gr.Blocks() as casa:
58
  title = "Casa-AI Demo"
59
  description = "A Gradio interface to use CasaAI for virtual staging"
@@ -102,4 +110,20 @@ with gr.Blocks() as casa:
102
  submit_btn = gr.Button("Find similar products!")
103
  submit_btn.click(casa_ai_run_tab3, inputs=inputs, outputs=outputs)
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  casa.launch()
 
54
 
55
  return results
56
 
57
+ def casa_ai_run_tab_sketch(image=None, room_type=None, room_style=None):
58
+
59
+ text = f"{room_type}, {room_style}"
60
+ f = modal.Cls.lookup("casa-interior-hf-v6-sketch", "DesignModel")
61
+ result_image = f.inference.remote(image, text)
62
+ return result_image
63
+
64
+
65
  with gr.Blocks() as casa:
66
  title = "Casa-AI Demo"
67
  description = "A Gradio interface to use CasaAI for virtual staging"
 
110
  submit_btn = gr.Button("Find similar products!")
111
  submit_btn.click(casa_ai_run_tab3, inputs=inputs, outputs=outputs)
112
 
113
+
114
+ with gr.Tab("Re"):
115
+ with gr.Row():
116
+ with gr.Column():
117
+ inputs = [
118
+ gr.Image(sources='upload', type="numpy", label="Upload"),
119
+ gr.Dropdown(["Living Room", "Bedroom", "Kitchen"], label="Room Type", info="Select Room Type"),
120
+ gr.Dropdown(["Modern", "Minimalist", "Scandinavian"], label="Style", info="Interior Style!"),
121
+ ]
122
+
123
+ with gr.Column():
124
+ outputs = [gr.Image(label="Image with new designed object")]
125
+
126
+ submit_btn = gr.Button("Redesign!")
127
+ submit_btn.click(casa_ai_run_tab_sketch, inputs=inputs, outputs=outputs)
128
+
129
  casa.launch()