Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,124 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: gpl-3.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: gpl-3.0
|
| 3 |
+
---
|
| 4 |
+
As always : More safe for everyone to share around and keep updated if any major changes then the google drive.
|
| 5 |
+
# Copy from github fork:
|
| 6 |
+
- [human-parser-comfyui-node-in-pure-python](https://github.com/Randy420Marsh/human-parser-comfyui-node-in-pure-python)
|
| 7 |
+
- This custom node doesn't require a runtime build for InPlaceABNSync.
|
| 8 |
+
- [original Github repo](https://github.com/cozymantis/human-parser-comfyui-node)
|
| 9 |
+
- Needs C++ build tools for windows
|
| 10 |
+
|
| 11 |
+
# Cozy Human Parser
|
| 12 |
+
|
| 13 |
+
Fast, VRAM-light ComfyUI nodes to generate masks for specific body parts and clothes or fashion items. Runs on CPU and CUDA.
|
| 14 |
+
Made with 💚 by the [CozyMantis](https://cozymantis.gumroad.com/) squad.
|
| 15 |
+
|
| 16 |
+
| Original | ATR | LIP | Pascal |
|
| 17 |
+
| --------------------- | ------------------------ | ------------------------ | ------------------------ |
|
| 18 |
+
|  |  |  |  |
|
| 19 |
+
|  |  |  |  |
|
| 20 |
+
|
| 21 |
+
## Installation
|
| 22 |
+
|
| 23 |
+
- Clone this repository into your custom_nodes directory, then run `pip install -r requirements.txt` to install the required dependencies.
|
| 24 |
+
- Copy the following models to the `models/schp` directory, depending on which parser you would like to use:
|
| 25 |
+
- Model based on the LIP dataset: [Google Drive](https://drive.google.com/file/d/1k4dllHpu0bdx38J7H28rVVLpU-kOHmnH/view?usp=sharing)
|
| 26 |
+
- Model based on the ATR dataset: [Google Drive](https://drive.google.com/file/d/1ruJg4lqR_jgQPj-9K0PP-L2vJERYOxLP/view?usp=sharing)
|
| 27 |
+
- Model based on the Pascal dataset: [Google Drive](https://drive.google.com/file/d/1E5YwNKW2VOEayK9mWCS3Kpsxf-3z04ZE/view?usp=sharing)
|
| 28 |
+
|
| 29 |
+
Check below for [Windows troubleshooting](#windows-troubleshooting).
|
| 30 |
+
|
| 31 |
+
## Examples
|
| 32 |
+
|
| 33 |
+
### LIP Parser
|
| 34 |
+
|
| 35 |
+
- LIP is the largest single person human parsing dataset with 50000+ images. This dataset focuses on complicated real scenarios.
|
| 36 |
+
- mIoU on LIP validation: 59.36 %
|
| 37 |
+
- The LIP parser can detect the following categories:
|
| 38 |
+
|
| 39 |
+
```
|
| 40 |
+
['Background', 'Hat', 'Hair', 'Glove', 'Sunglasses' 'Upper-clothes', 'Dress', 'Coat', 'Socks', 'Pants', 'Jumpsuits', 'Scarf', 'Skirt', 'Face', 'Left-arm', 'Right-arm', 'Left-leg', 'Right-leg', 'Left-shoe', 'Right-shoe']
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
|
| 45 |
+
### ATR Parser
|
| 46 |
+
|
| 47 |
+
- ATR is a large single person human parsing dataset with 17000+ images. This dataset focuses on fashion AI.
|
| 48 |
+
- mIoU on ATR test: 82.29%
|
| 49 |
+
- The ATR parser can detect the following categories:
|
| 50 |
+
|
| 51 |
+
```
|
| 52 |
+
['Background', 'Hat', 'Hair', 'Sunglasses', 'Upper-clothes', 'Skirt', 'Pants', 'Dress', 'Belt', 'Left-shoe', 'Right-shoe', 'Face', 'Left-leg', 'Right-leg', 'Left-arm', 'Right-arm', 'Bag', 'Scarf']
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
|
| 57 |
+
### Pascal Parser
|
| 58 |
+
|
| 59 |
+
- Pascal Person Part is a tiny single person human parsing dataset with 3000+ images. This dataset focuses on body parts segmentation.
|
| 60 |
+
- mIoU on Pascal-Person-Part validation: 71.46 %
|
| 61 |
+
- The Pascal parser can detect the following categories:
|
| 62 |
+
|
| 63 |
+
```
|
| 64 |
+
['Background', 'Head', 'Torso', 'Upper Arms', 'Lower Arms', 'Upper Legs', 'Lower Legs']
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
|
| 69 |
+
## Windows Troubleshooting
|
| 70 |
+
|
| 71 |
+
- ### Ninja is required to load C++ extensions
|
| 72 |
+
|
| 73 |
+
Windows can't find the "ninja.exe" file. The file is probably getting downloaded/installed to something like `X:\path\to\comfy\python_embeded\lib\site-packages\ninja\data\bin`, but it's not properly getting added to the system path, so the OS can't invoke it.
|
| 74 |
+
|
| 75 |
+
The solution is to:
|
| 76 |
+
- locate the "ninja.exe" file;
|
| 77 |
+
- add the full path to ninja.exe into the system PATH:
|
| 78 |
+
- see https://www.mathworks.com/matlabcentral/answers/94933-how-do-i-edit-my-system-path-in-windows
|
| 79 |
+
- remember, you need to enter the path to the folder containing the ninja.exe binary)
|
| 80 |
+
- see [this issue](https://github.com/cozymantis/human-parser-comfyui-node/issues/3) for more details
|
| 81 |
+
|
| 82 |
+
- ### NK1104: cannot open file 'python311.lib' (or similar)
|
| 83 |
+
|
| 84 |
+
Windows can't locate the `python311.lib` library. You need to search for it on your system, then add the library's parent directory to the "LIB" environment variable.
|
| 85 |
+
- see [this SO article](https://stackoverflow.com/questions/36419747/link-fatal-error-lnk1104-cannot-open-file-python27-lib)
|
| 86 |
+
- also see [this issue](https://github.com/cozymantis/human-parser-comfyui-node/issues/1)
|
| 87 |
+
|
| 88 |
+
- ### Command '['where', 'cl']' returned non-zero exit status 1
|
| 89 |
+
|
| 90 |
+
Windows can't locate "cl.exe" which is the compiler/linker tool: https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options?view=msvc-170
|
| 91 |
+
|
| 92 |
+
> You can start this tool only from a Visual Studio developer command prompt. You cannot start it from a system command prompt or from File Explorer. For more information, see Use the MSVC toolset from the command line.
|
| 93 |
+
|
| 94 |
+
First, make sure you've installed all of the things highlighted below:
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
|
| 98 |
+
Then, it looks like you'll need to start ComfyUI from the developer command prompt instead of the regular cmd. Here's docs on how to launch the dev command prompt: https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022
|
| 99 |
+
|
| 100 |
+
You'll want to run something similar to:
|
| 101 |
+
|
| 102 |
+
```bash
|
| 103 |
+
cd X:\path\to\comfy
|
| 104 |
+
python main.py
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
- ### error: first parameter of allocation function must be of type "size_t"
|
| 108 |
+
|
| 109 |
+
Make sure you're running the "x64 Native Tools Command Prompt" instead of the x86 one. Type "x64" in the start menu to locate it.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
|
| 113 |
+
## Acknowledgements
|
| 114 |
+
|
| 115 |
+
Based on the excellent paper ["Self-Correction for Human Parsing"](https://github.com/GoGoDuck912/Self-Correction-Human-Parsing) by Li, Peike and Xu, Yunqiu and Wei, Yunchao and Yang, Yi, and their original code that we've updated to also run on CPUs.
|
| 116 |
+
|
| 117 |
+
```bibtex
|
| 118 |
+
@article{li2020self,
|
| 119 |
+
title={Self-Correction for Human Parsing},
|
| 120 |
+
author={Li, Peike and Xu, Yunqiu and Wei, Yunchao and Yang, Yi},
|
| 121 |
+
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
|
| 122 |
+
year={2020},
|
| 123 |
+
doi={10.1109/TPAMI.2020.3048039}}
|
| 124 |
+
```
|