Closed szriru closed 1 year ago
Wow! Thank you so much.
It would be nice to use the existing extra
option instead of creating another option.
for example:
rembg i input.png out.png -m u2net_cloth_seg -x '{ "cloth-category": "lower" }'
@danielgatis
Thank you for reviewing.
I commited the fixed code.
It can be used with args like you provided: -x '{ "cloth-category": "lower" }
or --extras '{ "cc": "upper" }
I would appreciate if you can review again.
I tested with these commands, and it worked fine.
python rembg.py i input.jpg output.jpg -m u2net_cloth_seg -om
python rembg.py i input.jpg output.jpg -m u2net_cloth_seg -om -x '{"cc": "lower"}'
python rembg.py i input.jpg output.jpg -m u2net_cloth_seg -om --extras '{"cloth_category": "upper"}'
((We have to be careful because it will not work correctly if we swap single and double quotes due to a problem in cmd or shell or in the argment parser we use. We should put like '{"cc": "lower"}' not "{'cc': 'lower'}"))
Overview
This Pull Request adds cloth category selection feature when using u2net_cloth_seg
Changes Made
Users now can select which cloth category to "rembg" with a command -cc or --cloth-category. The values are "upper" or "lower" or "full", so it can be used like:
rembg i input.png out.png --model u2net_cloth_seg --cloth-category lower
Mensioned Issue
484
Testing
Tried "i" and "p" command with the new option "-cc" and "--cloth-category", and it worked fine.
Result example
python ./rembg.py i ./cc-example.jpg ./cc-example-out.jpg -om --model u2net_cloth_seg --cloth-category upper
Input
Output
Reviewer Notes
I would appreciate your review of this Pull Request.
Thank you.