Files changed (1) hide show
  1. README.md +39 -0
README.md CHANGED
@@ -1,3 +1,42 @@
1
  ---
2
  license: openrail
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: openrail
3
  ---
4
+
5
+ # Huggingface cloth segmentation using U2NET
6
+
7
+ ![Python 3.8](https://img.shields.io/badge/python-3.8-green.svg)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
9
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1LGgLiHiWcmpQalgazLgq4uQuVUm9ZM4M?usp=sharing)
10
+
11
+ This repo contains inference code and gradio demo script using pre-trained U2NET model for Cloths Parsing from human portrait.</br>
12
+ Here clothes are parsed into 3 category: Upper body(red), Lower body(green) and Full body(yellow). The provided script also generates alpha images for each class.
13
+
14
+
15
+ # Inference on local
16
+ - clone the repo `git clone https://github.com/wildoctopus/huggingface-cloth-segmentation.git`.
17
+ - Install dependencies `pip install -r requirements.txt`
18
+ - Run `python process.py --image 'input/03615_00.jpg' . **Script will automatically download the pretrained model**.
19
+ - Outputs will be saved in `output` folder.
20
+ - `output/alpha/..` contains alpha images corresponding to each class.
21
+ - `output/cloth_seg` contains final segmentation.
22
+ -
23
+
24
+ # Gradio Demo for colab/local
25
+ - Run `python app.py'
26
+ - Navigate to local or public url provided by app on successfull execution.
27
+ ### OR
28
+ - Inference in colab from here [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1LGgLiHiWcmpQalgazLgq4uQuVUm9ZM4M?usp=sharing)
29
+
30
+ # Huggingface Demo
31
+ - Check gradio demo on Huggingface space from here [huggingface-cloth-segmentation](https://huggingface.co/spaces/wildoctopus/cloth-segmentation).
32
+
33
+ # Output samples
34
+ ![Sample 000](assets/1.png)
35
+ ![Sample 024](assets/2.png)
36
+
37
+
38
+ This model works well with any background and almost all poses.
39
+
40
+ # Acknowledgements
41
+ - U2net model is from original [u2net repo](https://github.com/xuebinqin/U-2-Net). Thanks to Xuebin Qin for amazing repo.
42
+ - Most of the code is taken and modified from [levindabhi/cloth-segmentation](https://github.com/levindabhi/cloth-segmentation)