From 2144e76dacf43ba69770c068ca0d236b382c0844 Mon Sep 17 00:00:00 2001 From: didier amyot Date: Tue, 15 Oct 2024 19:32:54 -0400 Subject: [PATCH] Added readme --- README.md | 12 ++++++ flake.nix | 113 +++++++++++++++++++++++++++++------------------------- 2 files changed, 72 insertions(+), 53 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..42f4e87 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Python OpenCV Related Nix Flakes + +Collection of python library packaged in nix flakes to work with OpenCV +and other computer vision related libraries. + + +### Licenses + +The current work is only about re-distributing open source library. I have +tried to attach the proper license to the proper library. For any +licenses questions, or anything at all about the library, please give +all credits to packages author. diff --git a/flake.nix b/flake.nix index ec1da3b..10b4789 100644 --- a/flake.nix +++ b/flake.nix @@ -23,18 +23,18 @@ fetchSubmodules = true; }; - propagatedBuildInputs = [ pythonPackages.numpy ]; + propagatedBuildInputs = with pythonPackages; [ numpy ]; - nativeBuildInputs = [ - pythonPackages.setuptools - pythonPackages.setuptools-scm - pythonPackages.cython + nativeBuildInputs = with pythonPackages; [ + setuptools + setuptools-scm + cython ]; meta = with pkgs.lib; { description = "Linear Assignment Problem solver (LAPJV/LAPMOD)."; homepage = "https://github.com/rathaROG/lapx"; - license = pkgs.lib.licenses.mit; + license = pkgs.lib.licenses.bsd2; maintainers = with maintainers; [ ]; }; }; @@ -51,10 +51,12 @@ fetchSubmodules = true; }; - propagatedBuildInputs = [ pythonPackages.numpy pythonPackages.torch ]; + propagatedBuildInputs = with pythonPackages; [ numpy torch ]; - nativeBuildInputs = - [ pythonPackages.setuptools pythonPackages.setuptools-scm ]; + nativeBuildInputs = with pythonPackages; [ + setuptools + setuptools-scm + ]; meta = with pkgs.lib; { description = '' @@ -64,7 +66,7 @@ efficiency and memory footprint of deep learning models. ''; homepage = "https://github.com/ultralytics/thop"; - license = pkgs.lib.licenses.mit; + license = pkgs.lib.licenses.agpl3Only; maintainers = with maintainers; [ ]; }; }; @@ -82,18 +84,18 @@ }; # doCheck = false; - propagatedBuildInputs = [ - pythonPackages.requests - pythonPackages.pyyaml - pythonPackages.torch - pythonPackages.tqdm - pythonPackages.psutil - pythonPackages.torchvision - pythonPackages.pandas - pythonPackages.matplotlib - pythonPackages.seaborn - pythonPackages.py-cpuinfo - pythonPackages.opencv4 + propagatedBuildInputs = with pythonPackages; [ + requests + pyyaml + torch + tqdm + psutil + torchvision + pandas + matplotlib + seaborn + py-cpuinfo + opencv4 ultralytics-thop ]; @@ -101,10 +103,10 @@ pythonRelaxDeps = [ "torchvision" ]; pythonRemoveDeps = [ "opencv-python" ]; - nativeBuildInputs = [ - pythonPackages.setuptools - pythonPackages.setuptools-scm - pythonPackages.pip + nativeBuildInputs = with pythonPackages; [ + setuptools + setuptools-scm + pip ]; # nativeCheckInputs = [ ]; @@ -116,7 +118,7 @@ pose estimation and image classification. ''; homepage = "https://github.com/ultralytics/ultralytics"; - license = pkgs.lib.licenses.mit; + license = pkgs.lib.licenses.agpl3Only; maintainers = with maintainers; [ ]; }; }; @@ -134,49 +136,54 @@ fetchSubmodules = true; }; - propagatedBuildInputs = [ - pythonPackages.loguru - pythonPackages.numpy - pythonPackages.pandas - pythonPackages.pyyaml - pythonPackages.torch - pythonPackages.yacs - pythonPackages.torchvision - pythonPackages.ftfy - pythonPackages.filterpy - pythonPackages.gdown - pythonPackages.regex - pythonPackages.scikit-learn - pythonPackages.gitpython - pythonPackages.opencv4 - pythonPackages.pip + propagatedBuildInputs = with pythonPackages; [ + loguru + numpy + pandas + pyyaml + torch + yacs + torchvision + ftfy + filterpy + gdown + regex + scikit-learn + gitpython + opencv4 + pip + lapx ]; pythonRelaxDeps = [ "torchvision" ]; pythonRemoveDeps = [ "opencv-python" ]; - nativeBuildInputs = [ - pythonPackages.setuptools - pythonPackages.setuptools-scm - pythonPackages.poetry-core + nativeBuildInputs = with pythonPackages; [ + setuptools + setuptools-scm + poetry-core ]; meta = with pkgs.lib; { description = "Linear Assignment Problem solver (LAPJV/LAPMOD)."; homepage = "https://github.com/mikel-brostrom/boxmot"; - license = pkgs.lib.licenses.mit; + license = pkgs.lib.licenses.agpl3Only; maintainers = with maintainers; [ ]; }; }; - env = pkgs.python312.withPackages (ps: [ boxmot ]); - in { packages = { - default = pkgs.python312Packages.path; - env = env; + python312Packages.lapx = lapx; + python312Packages.ultralytics-thop = ultralytics-thop; + python312Packages.ultralytics = ultralytics; + python312Packages.boxmot = boxmot; + python312Packages.opencv4 = pythonPackages.opencv4; + }; + devShells.default = pkgs.mkShell { + buildInputs = + [ (pkgs.python312.withPackages (ps: [ boxmot ultralytics ])) ]; }; - devShells.default = pkgs.mkShell { buildInputs = [ env ]; }; }); }