MODNet icon indicating copy to clipboard operation
MODNet copied to clipboard

How to run image background removal on local computer

Open aksthelion opened this issue 3 years ago • 7 comments
trafficstars

Hello, Is there a demo code for removing image background which I can run on my local Ubuntu/MacOS system?

aksthelion avatar Dec 20 '21 21:12 aksthelion

Hi, thanks for your attention. Please check and try https://github.com/ZHKKKe/MODNet/blob/master/demo/image_matting/colab/inference.py

ZHKKKe avatar Dec 21 '21 20:12 ZHKKKe

I've already tried that, it gives error:

$ python3 main.py Traceback (most recent call last): File "main.py", line 12, in <module> from src.models.modnet import MODNet ModuleNotFoundError: No module named 'src'

aksthelion avatar Dec 21 '21 22:12 aksthelion

you have to check from where are you calling it. I got it running.

manzke avatar Jan 03 '22 19:01 manzke

@aksthelion you can checkout this repo, create a new file and copy the interference to it. I've done it here: https://gist.github.com/manzke/0a8bec5e13564e1a3f69fbd78e734493

manzke avatar Jan 10 '22 22:01 manzke

@manzke what is the version of torch and torchvision you used here?

nahidalam avatar Feb 04 '22 22:02 nahidalam

@nahidalam pls find attached. I haven't used conda yet, so it can be that it was overwritten by another test already. 🤦

Name: torch Version: 1.10.1 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org/ Author: PyTorch Team Author-email: [email protected] License: BSD-3 Location: /usr/local/lib/python3.9/site-packages Requires: typing-extensions Required-by: kornia, labml-helpers, labml-nn, lpips, torchtext, torchvision

Name: torchvision Version: 0.11.2 Summary: image and video datasets and models for torch deep learning Home-page: https://github.com/pytorch/vision Author: PyTorch Core Team Author-email: [email protected] License: BSD Location: /usr/local/lib/python3.9/site-packages Requires: numpy, pillow, torch Required-by: labml-nn, lpips

manzke avatar Feb 08 '22 12:02 manzke

@aksthelion, I solved this problem by moving modnet.py and the bachbones package to another location. Then I referenced it in from with the new location.

LucasFernandesBrazil avatar Mar 22 '22 20:03 LucasFernandesBrazil