Git Product home page Git Product logo

clothseg's People

Contributors

graemeniedermayer avatar poptropica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

clothseg's Issues

Error loading script: remove_bg.py in latest sd webui?

Hi @graemeniedermayer

thx for all the efforts there.

so far, my sd will shows following error on start after installation

Python 3.10.0 (default, Aug 27 2023, 13:35:08) [GCC 12.3.0]
Version: v1.6.0
This extension has been automatically deactivated
Please remove this extension
==========================================================================

*** Error loading script: remove_bg.py
    Traceback (most recent call last):
      File "/home/xxx/servers/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/home/xxx/servers/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/home/xxx/servers/stable-diffusion-webui/extensions/clothseg/scripts/remove_bg.py", line 19, in <module>
        from rembg import remove, new_session
    ModuleNotFoundError: No module named 'rembg'

---

even I've executed

pip install rem_bg

successfully, it still cannot load, any ideas why?

thx in advance!

A few questions when using the Extras / Batch and mask padding?

Thanks for this script. Everything works as described for individual images.

I was trying to do batch clothing segmentation using the extras tab. It works but it always spits out the 3 masks all in one image (Top+bottom+combined). Is there a way to only spit out one? I'm not sure if I'm missing a step here.

2 addition questions:

  • will there be an ALL clothing option? For example, TOP+BOTTOM+COMBINED for masking?
  • when masking, is there way to pad / expand the mask a bit by user entered # of pixels? I find the mask sometimes has missed just a little bit so I end up using manual inpainting. If I can expand the mask by say 15 pixels, everything would be perfect.

Thanks again for the great work!

TypeError: _argmax_dispatcher() got an unexpected keyword argument 'keepdims'

Error completing request
Arguments: ('task(nc1hvqo5kce170y)', 0, '', '', [], <PIL.Image.Image image mode=RGBA size=1440x1800 at 0x7F60747EB7F0>, None, None, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 0, -1.0, -1.0, 0, 0, 0, False, 512, 512, 1, 0, 32, 0, '', '', '', [], 9, '<ul>\n<li><code>CFG Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 1, '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 1, '', 0, '', 0, '', True, False, False, False, 'u2net_cloth_seg', True, True, True, True) {}
Traceback (most recent call last):
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 56, in f
    res = list(func(*args, **kwargs))
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/img2img.py", line 166, in img2img
    processed = modules.scripts.scripts_img2img.run(p, *args)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/scripts.py", line 376, in run
    processed = script.run(p, *script_args)
  File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/extensions/clothseg/scripts/remove_bg.py", line 83, in run
    remove_img = remove(processed.images[count], session=session)
  File "/usr/local/lib/python3.8/dist-packages/rembg/bg.py", line 135, in remove
    masks = session.predict(img)
  File "/usr/local/lib/python3.8/dist-packages/rembg/session_cloth.py", line 64, in predict
    pred = np.argmax(pred, axis=1, keepdims=True)
  File "<__array_function__ internals>", line 4, in argmax
TypeError: _argmax_dispatcher() got an unexpected keyword argument 'keepdims'

This problem is only with u2net_cloth_seg. Other models work fine.

Maybe I'm just doing something wrong?
I go into img2img and select the image, then in Script I select remove_bg v0.0.2 and run.

Denoising strength to 0 (I don't want the image to change).

automated dependency installation?

I tried this recently and it works very nicely. any way we could have rembg install automatically?

the package requests Pillow 9.3, and webui uses 9.4

i can see why the install of rembg can cause issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.