Mayur2 commited on
Commit
dc24926
·
1 Parent(s): 291c69c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -135,18 +135,18 @@ def upload_and_process(image, promptText, promptImg, lens_option, n_images, size
135
  # formatted_json += char
136
 
137
  # print(formatted_json)
138
- dall_e_prompt = promptImg + " , " + lens_option
139
- # Generate variations using DALL-E
140
- removeBackdrop(image_path, "temp_no_bg.png")
141
- NoBackImg = "temp_no_bg.png"
142
- response_data = DallEBackdropGen("temp_no_bg.png", dall_e_prompt, n_images, size)
143
 
144
- # Get and return the images
145
- result_images = outputGenImages(image_path, response_data)
146
 
147
- text_output = f"<h2>{json.dumps(responses, indent=2)}</h2>"
148
 
149
- return text_output, result_images # Output should be a list of PIL Image objects or numpy arrays
150
 
151
  lens_options = [
152
  "Sigma 85 mm f/1.4 (good for portrait)",
@@ -168,7 +168,7 @@ iface = gr.Interface(
168
  ],
169
  outputs=[
170
  gr.outputs.HTML(label="Generated Text"),
171
- gr.outputs.Image(type="pil", label="Generated Images"), # adjust the size as per your need
172
  ],
173
  title="Facebook Ad Creation",
174
  )
 
135
  # formatted_json += char
136
 
137
  # print(formatted_json)
138
+ # dall_e_prompt = promptImg + " , " + lens_option
139
+ # # Generate variations using DALL-E
140
+ # removeBackdrop(image_path, "temp_no_bg.png")
141
+ # NoBackImg = "temp_no_bg.png"
142
+ # response_data = DallEBackdropGen("temp_no_bg.png", dall_e_prompt, n_images, size)
143
 
144
+ # # Get and return the images
145
+ # result_images = outputGenImages(image_path, response_data)
146
 
147
+ # text_output = f"<h2>{json.dumps(responses, indent=2)}</h2>"
148
 
149
+ return text_output#, result_images # Output should be a list of PIL Image objects or numpy arrays
150
 
151
  lens_options = [
152
  "Sigma 85 mm f/1.4 (good for portrait)",
 
168
  ],
169
  outputs=[
170
  gr.outputs.HTML(label="Generated Text"),
171
+ # gr.outputs.Image(type="pil", label="Generated Images"), # adjust the size as per your need
172
  ],
173
  title="Facebook Ad Creation",
174
  )