OPHoperHPO / image-background-remove-tool

✂️ Automated high-quality background removal framework for an image using neural networks. ✂️
https://carve.photos
Apache License 2.0
1.39k stars 272 forks source link

Deprecated dependencies #147

Closed JimmyRittenborg closed 7 months ago

JimmyRittenborg commented 8 months ago

I'm having issues due to Torch 2.1.2 not being easily available anymore, and if solved by miniconda I'm instead getting this which seems to halt the processing completely - maybe I'm just stupid for trying to run this locally on my MacBook Pro with Apple M1 Pro chip? 🤷🏼‍♂️

Removing background:   0%|                     | 0/30 [00:00<?, ? image batch/s]/opt/miniconda3/envs/myenv/lib/python3.10/site-packages/torchvision/transforms/functional.py:1603: UserWarning: The default value of the antialias parameter of all the resizing transforms (Resize(), RandomResizedCrop(), etc.) will change from None to True in v0.17, in order to be consistent across the PIL and Tensor backends. To suppress this warning, directly pass antialias=True (recommended, future default), antialias=None (current default, which means False for Tensors and True for PIL), or antialias=False (only works on Tensors - PIL will still use antialiasing). This also applies if you are using the inference transforms from the models weights: update the call to weights.transforms(antialias=True).
  warnings.warn(
Removing background:   0%|                     | 0/30 [00:18<?, ? image batch/s]
EasternJournalist commented 8 months ago

I met similar problems. Carvekit denpendencies are too strict, and pip install carvekit attempts to downgrade the whole dependencies 👎 . In fact, many dependencies that cannot be resolved are likely compatible minor version differences. For example, my environment is like:

carvekit 4.1.1 requires typing~=3.7.4.3, which is not installed.
carvekit 4.1.1 requires aiofiles~=23.2.1, but you have aiofiles 22.1.0 which is incompatible.
carvekit 4.1.1 requires fastapi~=0.108.0, but you have fastapi 0.110.0 which is incompatible.
carvekit 4.1.1 requires opencv-python~=4.8.1.78, but you have opencv-python 4.9.0.80 which is incompatible.
carvekit 4.1.1 requires Pillow==10.1.0, but you have pillow 10.2.0 which is incompatible.
carvekit 4.1.1 requires pydantic~=2.5.3, but you have pydantic 2.6.1 which is incompatible.
carvekit 4.1.1 requires setuptools~=69.0.3, but you have setuptools 65.6.3 which is incompatible.
carvekit 4.1.1 requires torch~=2.1.2, but you have torch 2.2.0+cu118 which is incompatible.
carvekit 4.1.1 requires torchvision~=0.16.2, but you have torchvision 0.17.0+cu118 which is incompatible.
carvekit 4.1.1 requires tqdm~=4.66.1, but you have tqdm 4.65.0 which is incompatible.
carvekit 4.1.1 requires uvicorn~=0.25.0, but you have uvicorn 0.27.1 which is incompatible.

Pillow==10.1.0 is incompatible with pillow 10.2.0 for carvekit? I won't believe that.

I guess you may try pip install carvekit --no-dependencies to skip installing the dependencies, then manually install the latest version of the dependent packages (if they have not been installed). If you are lucky, everything will work well with very few dependencies requiring manual installation.

OPHoperHPO commented 8 months ago

Hello,

I've noticed the issue, and an update with a fix for this will be released in a few days.

You can expedite the process and prepare an update for the dependencies following the example of changes in this Pull Request. I will merge it if one is submitted.

OPHoperHPO commented 7 months ago

Dependencies updated to latest versions