matteomarjanovic commited on
Commit
1bd4c24
·
1 Parent(s): 25a9340

refine prompt for specifying only front and fix image

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -81,13 +81,15 @@ def encode_image(pil_image):
81
  description_prompt = """
82
  I want you to imagine how the technical flat sketch of the garment you see in the picture would look like, and describe it in rich details, in one paragraph.
83
  Don't add any additional comment.
84
- Specify that the flat sketch is black and white (even if the original garment has a color), that it doesn't include the person that wear the garment, and that it's not made on a paper sheet, but it's digitally made, so it has plain white background, not paper.
 
 
85
  It should start with "The technical flat sketch of..."
86
 
87
 
88
  The style of the result should look somewhat like the following example:
89
  The technical flat sketch of the dress depicts a midi-length, off-the-shoulder design with a smocked bodice and short puff sleeves that have elasticized cuffs.
90
- The elastic neckline sits straight across the chest and back, ensuring a secure fit.
91
  The bodice transitions into a flowy, tiered skirt with three evenly spaced gathered panels, creating soft volume.
92
  Elasticized areas are marked with textured lines, while the gathers and drape is indicated through subtle curved strokes, ensuring clarity in construction details.
93
  The flat sketch does NOT include any person and it's only the in black and white, being a technical drawing.
@@ -183,6 +185,7 @@ css = """
183
  }
184
  """
185
 
 
186
 
187
  # generated_prompt = ""
188
 
@@ -191,7 +194,7 @@ with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
191
  with gr.Row():
192
  with gr.Column(elem_id="col-input-image"):
193
  # gr.Markdown(" ## Drop your image here")
194
- input_image = gr.Image(type="pil", value="./hoodie.webp")
195
  with gr.Column(elem_id="col-container"):
196
  generate_button = gr.Button("Generate flat sketch", scale=0, variant="primary", elem_classes="btn btn-primary")
197
 
 
81
  description_prompt = """
82
  I want you to imagine how the technical flat sketch of the garment you see in the picture would look like, and describe it in rich details, in one paragraph.
83
  Don't add any additional comment.
84
+ Specify that the flat sketch is black and white (even if the original garment has a color) and that it doesn't include the person that wear the garment.
85
+ Clarify that it's not made on a paper sheet, but it's digitally made, so it has plain white background, not paper.
86
+ Describe only the part that is visible in the picture (front or back of the garment, not both).
87
  It should start with "The technical flat sketch of..."
88
 
89
 
90
  The style of the result should look somewhat like the following example:
91
  The technical flat sketch of the dress depicts a midi-length, off-the-shoulder design with a smocked bodice and short puff sleeves that have elasticized cuffs.
92
+ The elastic neckline sits straight across the chest, ensuring a secure fit.
93
  The bodice transitions into a flowy, tiered skirt with three evenly spaced gathered panels, creating soft volume.
94
  Elasticized areas are marked with textured lines, while the gathers and drape is indicated through subtle curved strokes, ensuring clarity in construction details.
95
  The flat sketch does NOT include any person and it's only the in black and white, being a technical drawing.
 
185
  }
186
  """
187
 
188
+ image_path = os.path.abspath("./hoodie.webp")
189
 
190
  # generated_prompt = ""
191
 
 
194
  with gr.Row():
195
  with gr.Column(elem_id="col-input-image"):
196
  # gr.Markdown(" ## Drop your image here")
197
+ input_image = gr.Image(type="pil", value=image_path)
198
  with gr.Column(elem_id="col-container"):
199
  generate_button = gr.Button("Generate flat sketch", scale=0, variant="primary", elem_classes="btn btn-primary")
200