NikhilJoson commited on
Commit
63ac632
·
verified ·
1 Parent(s): 54aabc9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -27,8 +27,8 @@ def predict_clothing(images):
27
  input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
28
 
29
  output_texts = []
30
- for url in images:
31
- image = Image.open(requests.get(url, stream=True).raw)
32
  print(type(image))
33
  inputs = processor(image, input_text, add_special_tokens=False, return_tensors="pt").to(model.device)
34
  with torch.no_grad():
@@ -157,8 +157,9 @@ with gr.Blocks() as demo:
157
  use_input_image_size_as_output = gr.Checkbox(
158
  label="use_input_image_size_as_output", info="Automatically adjust the output image size to be same as input image size. For editing and controlnet task, it can make sure the output image has the same size as input image leading to better performance", value=False,)
159
 
 
160
  # generate
161
- generate_button = gr.Button("Generate Image")
162
 
163
  with gr.Row():
164
  # output image
 
27
  input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
28
 
29
  output_texts = []
30
+ for img_path in images:
31
+ image = Image.open(img_path)
32
  print(type(image))
33
  inputs = processor(image, input_text, add_special_tokens=False, return_tensors="pt").to(model.device)
34
  with torch.no_grad():
 
157
  use_input_image_size_as_output = gr.Checkbox(
158
  label="use_input_image_size_as_output", info="Automatically adjust the output image size to be same as input image size. For editing and controlnet task, it can make sure the output image has the same size as input image leading to better performance", value=False,)
159
 
160
+ with gr.Row():
161
  # generate
162
+ generate_button = gr.Button("Try On!")
163
 
164
  with gr.Row():
165
  # output image