NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.6k stars 13.08k forks source link

Package request: rembg #308329

Open Sntx626 opened 2 months ago

Sntx626 commented 2 months ago

Project description

Rembg is a tool to remove image backgrounds.

Metadata


Add a :+1: reaction to issues you find important.

kacperwyczawski commented 2 months ago

I tried to implement it, but got stuck on an error related to opencv-python-headless. Here is what I've written:

{
  python3Packages,
  fetchFromGitHub,
}:

with python3Packages;
buildPythonApplication {
  pname = "rembg";
  version = "v2.0.56";

  propagatedBuildInputs = [
    jsonschema
    numpy
    onnxruntime
    opencv4 # <-- problematic dependency
    pillow
    pooch
    pymatting
    scikit-image
    scipy
    tqdm
    pip
  ];

  src = fetchFromGitHub {
    owner = "danielgatis";
    repo = "rembg";
    rev = "v2.0.56";    
    sha256 = "19s9qqq5jbj6qds62iv3b2c9nslmyh2i8rl6pi74r8glzcd7vk8x";
  };
}

Edit: seems like this is related to https://github.com/NixOS/nixpkgs/issues/157397