andreyp89 commited on
Commit
a9646f6
β€’
1 Parent(s): a788f45

Updated the demo and API docs for the latest API release with support of clothing-only images (on ghost mannequins or flat lay photos)

Browse files
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ‘—
4
  colorFrom: indigo
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 5.6.0
8
  app_file: app.py
9
  pinned: false
10
  short_description: Diffusion-based multi-modal virtual try-on pipeline demo
 
4
  colorFrom: indigo
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 5.9.0
8
  app_file: app.py
9
  pinned: false
10
  short_description: Diffusion-based multi-modal virtual try-on pipeline demo
app.py CHANGED
@@ -133,7 +133,7 @@ with gr.Blocks(theme=gr.themes.Soft(), delete_cache=(3600, 3600)) as app:
133
  clothing_image = gr.Image(label="Clothing Image", sources=["upload"], type="numpy")
134
 
135
  clothing_image_examples = gr.Examples(
136
- inputs=clothing_image, examples_per_page=12, examples=get_examples("clothing")
137
  )
138
 
139
  with gr.Tab("Prompt"):
@@ -175,7 +175,7 @@ with gr.Blocks(theme=gr.themes.Soft(), delete_cache=(3600, 3600)) as app:
175
 
176
  avatar_image_examples = gr.Examples(
177
  inputs=avatar_image,
178
- examples_per_page=12,
179
  examples=get_examples("avatar"),
180
  )
181
 
@@ -224,7 +224,7 @@ with gr.Blocks(theme=gr.themes.Soft(), delete_cache=(3600, 3600)) as app:
224
  background_image = gr.Image(label="Background Image", sources=["upload"], type="numpy")
225
 
226
  background_image_examples = gr.Examples(
227
- inputs=background_image, examples_per_page=12, examples=get_examples("background")
228
  )
229
 
230
  with gr.Tab("Prompt"):
 
133
  clothing_image = gr.Image(label="Clothing Image", sources=["upload"], type="numpy")
134
 
135
  clothing_image_examples = gr.Examples(
136
+ inputs=clothing_image, examples_per_page=18, examples=get_examples("clothing")
137
  )
138
 
139
  with gr.Tab("Prompt"):
 
175
 
176
  avatar_image_examples = gr.Examples(
177
  inputs=avatar_image,
178
+ examples_per_page=18,
179
  examples=get_examples("avatar"),
180
  )
181
 
 
224
  background_image = gr.Image(label="Background Image", sources=["upload"], type="numpy")
225
 
226
  background_image_examples = gr.Examples(
227
+ inputs=background_image, examples_per_page=18, examples=get_examples("background")
228
  )
229
 
230
  with gr.Tab("Prompt"):
docs/API.md CHANGED
@@ -21,11 +21,13 @@
21
  * [Image-based virtual try-on with background](#image-based-virtual-try-on-with-background)
22
  * [Avatar from a text prompt](#avatar-from-a-text-prompt)
23
  * [Clothing from a text prompt](#clothing-from-a-text-prompt)
 
24
  * [Modifying avatar's body](#modifying-avatars-body)
25
  * [Txt2Img](#txt2img)
26
  * [Other creative possibilities](#other-creative-possibilities)
27
  * [Performance](#performance)
28
  * [Known Issues and Limitations](#known-issues-and-limitations)
 
29
  <!-- TOC -->
30
 
31
  ## Summary
@@ -114,7 +116,7 @@ For best results clothing reference images should meet a number of requirements:
114
  - Maximum file size: **12 MB**
115
  - Minimum image size: **256x256**
116
  - Recommended image size: **768x1024 and above**
117
- - Clothing should be **dressed on a person**. Some flat lay clothing photos might work, but currently it's not guaranteed
118
  - **Single person** on the image (though multiple persons might also work)
119
  - **Frontal** photo, though some degree of rotation is fine
120
  - **Good lighting** conditions and **high image quality** as it directly affects the result
@@ -124,8 +126,8 @@ To summarize: the better is the clothing image the better is the final result.
124
 
125
  Examples of good clothing images:
126
 
127
- | <img src="images/clothing_image_01.jpg" width="240"> | <img src="images/clothing_image_02.jpg" width="240"> | <img src="images/clothing_image_03.jpg" width="240"> | <img src="images/clothing_image_04.jpg" width="240"> |
128
- |------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|
129
 
130
  ### Clothing prompt
131
 
@@ -243,6 +245,7 @@ user avatar) while maintaining the avatar and the background.
243
  | Clothing Image | Avatar Image | Result Image |
244
  |------------------------------------------------------|----------------------------------------------------|----------------------------------------------------------|
245
  | <img src="images/clothing_image_01.jpg" width="240"> | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/image_based_result_01.jpg" width="240"> |
 
246
 
247
  ### Image-based virtual try-on with background
248
 
@@ -283,6 +286,15 @@ Similarly, you can specify clothing with a text prompt while providing an avatar
283
  | a sheer blue sleeveless mini dress | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/clothing_prompt_result_01.jpg" width="240"> |
284
  | a colorful t-shirt and black shorts | <img src="images/avatar_image_03.jpg" width="240"> | <img src="images/clothing_prompt_result_02.jpg" width="240"> |
285
 
 
 
 
 
 
 
 
 
 
286
  ### Modifying avatar's body
287
 
288
  If you specify clothing and avatar images to be the same while providing an avatar prompt it's possible to change
@@ -315,9 +327,9 @@ replace the background in a creative way:
315
  It's also possible to use a combination of clothing image, clothing prompt, avatar image and a background to add some
316
  accessories:
317
 
318
- | Clothing Image | Clothing Prompt | Avatar Image | Background Image | Result Image |
319
- |------------------------------------------------------|--------------------------|------------------------------------------------------|--------------------------------------------------------|------------------------------------------------------------------|
320
- | <img src="images/avatar_image_02.jpg" width="240"> | a (light brown purse)+++ | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/background_image_03.jpg" width="240"> | <img src="images/accessory_result_01.jpg" width="240"> |
321
 
322
  ## Performance
323
 
@@ -337,5 +349,14 @@ As any generative model, our models are not perfect (though we constantly work o
337
  - Currently, we do not support trying on a single garment, only the full look.
338
  - Hats and sunglasses are not currently transferred, but we are working on it.
339
  - Backgrounds might lack some clarity as currently we focus more on clothing.
340
- - In case of a specified background a hairstyle might change.
341
  - Body shape of the avatar might change towards smaller sizes.
 
 
 
 
 
 
 
 
 
 
21
  * [Image-based virtual try-on with background](#image-based-virtual-try-on-with-background)
22
  * [Avatar from a text prompt](#avatar-from-a-text-prompt)
23
  * [Clothing from a text prompt](#clothing-from-a-text-prompt)
24
+ * [Modifying clothing](#modifying-clothing)
25
  * [Modifying avatar's body](#modifying-avatars-body)
26
  * [Txt2Img](#txt2img)
27
  * [Other creative possibilities](#other-creative-possibilities)
28
  * [Performance](#performance)
29
  * [Known Issues and Limitations](#known-issues-and-limitations)
30
+ * [Changelog](#changelog)
31
  <!-- TOC -->
32
 
33
  ## Summary
 
116
  - Maximum file size: **12 MB**
117
  - Minimum image size: **256x256**
118
  - Recommended image size: **768x1024 and above**
119
+ - For best results clothing should be **dressed on a person** or **on a ghost mannequin**. Some flat lay clothing photos might work too, but currently it's not guaranteed.
120
  - **Single person** on the image (though multiple persons might also work)
121
  - **Frontal** photo, though some degree of rotation is fine
122
  - **Good lighting** conditions and **high image quality** as it directly affects the result
 
126
 
127
  Examples of good clothing images:
128
 
129
+ | <img src="images/clothing_image_01.jpg" width="240"> | <img src="images/clothing_image_02.jpg" width="240"> | <img src="images/clothing_image_03.jpg" width="240"> | <img src="images/clothing_image_04.jpg" width="240"> | <img src="images/clothing_image_05.jpg" width="240"> | <img src="images/clothing_image_06.jpg" width="240"> |
130
+ |------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|------------------------------------------------------|
131
 
132
  ### Clothing prompt
133
 
 
245
  | Clothing Image | Avatar Image | Result Image |
246
  |------------------------------------------------------|----------------------------------------------------|----------------------------------------------------------|
247
  | <img src="images/clothing_image_01.jpg" width="240"> | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/image_based_result_01.jpg" width="240"> |
248
+ | <img src="images/clothing_image_05.jpg" width="240"> | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/image_based_result_02.jpg" width="240"> |
249
 
250
  ### Image-based virtual try-on with background
251
 
 
286
  | a sheer blue sleeveless mini dress | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/clothing_prompt_result_01.jpg" width="240"> |
287
  | a colorful t-shirt and black shorts | <img src="images/avatar_image_03.jpg" width="240"> | <img src="images/clothing_prompt_result_02.jpg" width="240"> |
288
 
289
+ ### Modifying clothing
290
+
291
+ It's possible to modify clothing to some extent using a clothing image and a clothing prompt simultaneously:
292
+
293
+ | Clothing Image | Clothing prompt | Avatar Image | Result Image |
294
+ |------------------------------------------------------|-------------------|----------------------------------------------------|--------------------------------------------------------------------|
295
+ | <img src="images/clothing_image_06.jpg" width="240"> | (long sleeves)+++ | <img src="images/avatar_image_03.jpg" width="240"> | <img src="images/clothing_modification_result_01.jpg" width="240"> |
296
+ | <img src="images/clothing_image_03.jpg" width="240"> | shorts+++ | <img src="images/avatar_image_04.jpg" width="240"> | <img src="images/clothing_modification_result_02.jpg" width="240"> |
297
+
298
  ### Modifying avatar's body
299
 
300
  If you specify clothing and avatar images to be the same while providing an avatar prompt it's possible to change
 
327
  It's also possible to use a combination of clothing image, clothing prompt, avatar image and a background to add some
328
  accessories:
329
 
330
+ | Clothing Image | Clothing Prompt | Avatar Image | Background Image | Result Image |
331
+ |------------------------------------------------------|--------------------------|------------------------------------------------------|--------------------------------------------------------|--------------------------------------------------------|
332
+ | <img src="images/avatar_image_02.jpg" width="240"> | a (light brown purse)+++ | <img src="images/avatar_image_02.jpg" width="240"> | <img src="images/background_image_03.jpg" width="240"> | <img src="images/accessory_result_01.jpg" width="240"> |
333
 
334
  ## Performance
335
 
 
349
  - Currently, we do not support trying on a single garment, only the full look.
350
  - Hats and sunglasses are not currently transferred, but we are working on it.
351
  - Backgrounds might lack some clarity as currently we focus more on clothing.
352
+ - In case of a specified background a hairstyle might slightly change.
353
  - Body shape of the avatar might change towards smaller sizes.
354
+
355
+ ## Changelog
356
+
357
+ The changelog below contains major API updates focusing on new features and other improvements.
358
+
359
+ - **2024-12-15**: New API release brings support for clothing on ghost mannequins and (partially) flat lay clothing
360
+ photos.
361
+
362
+ - **2024-11-07**: Initial public API release.
docs/images/clothing_image_05.jpg ADDED

Git LFS Details

  • SHA256: 76474dfec1c6628801dc04e067b07e52975ece542777625a5d3bfb4bc62bc338
  • Pointer size: 131 Bytes
  • Size of remote file: 172 kB
docs/images/clothing_image_06.jpg ADDED

Git LFS Details

  • SHA256: 1dce65a08816ca34587271e35878646e049a54be1e4e7124d5f027a99e01b292
  • Pointer size: 130 Bytes
  • Size of remote file: 85.9 kB
docs/images/clothing_modification_result_01.jpg ADDED

Git LFS Details

  • SHA256: c901b272c69a2148dd1fa18eab396b89e04552ee03274edc274e73e07153c2d6
  • Pointer size: 130 Bytes
  • Size of remote file: 53.4 kB
docs/images/clothing_modification_result_02.jpg ADDED

Git LFS Details

  • SHA256: ba17cb5fbe00b1ad56631b2a05b746afe4da3fac9d147147b5c8c984d38d42b6
  • Pointer size: 131 Bytes
  • Size of remote file: 101 kB
docs/images/image_based_result_02.jpg ADDED

Git LFS Details

  • SHA256: cc4c904cc629c9d698b772efb92497b5738556d78aa8d264b898f9d487ad0816
  • Pointer size: 130 Bytes
  • Size of remote file: 60.5 kB
examples/clothing/female_05.jpg CHANGED

Git LFS Details

  • SHA256: dac6b6ca50e3a81fe1c01f6a5975f894cdd2c5553705325d5d8dfa66447f41f4
  • Pointer size: 131 Bytes
  • Size of remote file: 245 kB

Git LFS Details

  • SHA256: 4f472bbfd2f8203a97efcd901e55852ef9f958e24f4d2e6fc99fe07c00b613b0
  • Pointer size: 131 Bytes
  • Size of remote file: 347 kB
examples/clothing/female_07.jpg ADDED

Git LFS Details

  • SHA256: 9173b1f667e8d56c056a21cdfce5cf499b2069b3e2fc4e0f945482b43b136fe0
  • Pointer size: 131 Bytes
  • Size of remote file: 173 kB
examples/clothing/female_08.jpg ADDED

Git LFS Details

  • SHA256: a7023a5d72438f9aedee1f101a133c6960e685bd72c3728514ed7b21a1c08908
  • Pointer size: 131 Bytes
  • Size of remote file: 131 kB
examples/clothing/female_09.jpg ADDED

Git LFS Details

  • SHA256: 76474dfec1c6628801dc04e067b07e52975ece542777625a5d3bfb4bc62bc338
  • Pointer size: 131 Bytes
  • Size of remote file: 172 kB
examples/clothing/male_07.jpg ADDED

Git LFS Details

  • SHA256: 1dce65a08816ca34587271e35878646e049a54be1e4e7124d5f027a99e01b292
  • Pointer size: 130 Bytes
  • Size of remote file: 85.9 kB
examples/clothing/male_08.jpg ADDED

Git LFS Details

  • SHA256: 475bc4fb65fc5881de3a2c385e49be859745c18b7112e37a4cb4839d4569d16e
  • Pointer size: 131 Bytes
  • Size of remote file: 122 kB
examples/clothing/male_09.jpg ADDED

Git LFS Details

  • SHA256: b1cd1fe33614de52886c9786148da607a927f83a99126ea3fd87205657e4d003
  • Pointer size: 131 Bytes
  • Size of remote file: 160 kB