NikhilJoson commited on
Commit
b220391
·
verified ·
1 Parent(s): e7b917d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -22,7 +22,7 @@ def predict_clothing(images):
22
  messages = [{"role": "user", "content":
23
  [
24
  {"type": "image"},
25
- {"type": "text", "text": "Define this clothing in 1-3 words. Your response should be only the definition."}
26
  ]}
27
  ]
28
  input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
@@ -57,10 +57,10 @@ def generate_image(category, img1, img2, img3, height, width, img_guidance_scale
57
  wears = predict_clothing(input_images[1:])
58
  if len(wears)==1:
59
  dress = wears[0]
60
- text = f"""A {category} posing straight in a {dress}. The {category} is in <img><|image_1|></img>. The {dress} is in <img><|image_2|></img>."""
61
  elif len(wears)==2:
62
  topwear, bottomwear = wears[0], wears[1]
63
- text = f"""A {category} posing straight in a {topwear} and a {bottomwear}. The {category} is in <img><|image_1|></img>.
64
  The {topwear} is in <img><|image_2|></img>. The {bottomwear} is in <img><|image_3|></img>."""
65
  else:
66
  input_images = None
 
22
  messages = [{"role": "user", "content":
23
  [
24
  {"type": "image"},
25
+ {"type": "text", "text": "Define this clothing in 1-3 words, always include the colour of the clothing too. Your response should be only the definition."}
26
  ]}
27
  ]
28
  input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
 
57
  wears = predict_clothing(input_images[1:])
58
  if len(wears)==1:
59
  dress = wears[0]
60
+ text = f"""The {category} in <img><|image_1|></img> in a {dress}. The {dress} is in <img><|image_2|></img>."""
61
  elif len(wears)==2:
62
  topwear, bottomwear = wears[0], wears[1]
63
+ text = f"""The {category} in <img><|image_1|></img> in a {topwear} and a {bottomwear}.
64
  The {topwear} is in <img><|image_2|></img>. The {bottomwear} is in <img><|image_3|></img>."""
65
  else:
66
  input_images = None