From 79c848fd131d8114516b7478f4740c310a4df746 Mon Sep 17 00:00:00 2001 From: happysalada Date: Wed, 12 Jul 2023 23:36:31 +0800 Subject: [PATCH] python310Packages.ninja: init at 0.6 --- .../python-modules/detectron2/default.nix | 99 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 101 insertions(+) create mode 100644 pkgs/development/python-modules/detectron2/default.nix diff --git a/pkgs/development/python-modules/detectron2/default.nix b/pkgs/development/python-modules/detectron2/default.nix new file mode 100644 index 000000000000..da273415d831 --- /dev/null +++ b/pkgs/development/python-modules/detectron2/default.nix @@ -0,0 +1,99 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pythonRelaxDepsHook +, ninja +# build inputs +, pillow +, matplotlib +, pycocotools +, termcolor +, yacs +, tabulate +, cloudpickle +, tqdm +, tensorboard +, fvcore +, iopath +, omegaconf +, hydra-core +, black +, packaging +# optional dependencies +, fairscale +, timm +, scipy +, shapely +, pygments +, psutil +}: + +let + name = "detectron2"; + version = "0.6"; + optional-dependencies = { + all = [ + fairscale + timm + scipy + shapely + pygments + psutil + ]; + }; +in +buildPythonPackage { + inherit name version; + + src = fetchFromGitHub { + owner = "facebookresearch"; + repo = name; + rev = "v${version}"; + sha256 = "1w6cgvc8r2lwr72yxicls650jr46nriv1csivp2va9k1km8jx2sf"; + }; + + nativeBuildInputs = [ + pythonRelaxDepsHook + ninja + ]; + + dontUseNinjaBuild = true; + dontUseNinjaInstall = true; + dontUseNinjaCheck = true; + + pythonRelaxDeps = [ + "black" + ]; + + propagatedBuildInputs = [ + pillow + matplotlib + pycocotools + termcolor + yacs + tabulate + cloudpickle + tqdm + tensorboard + fvcore + iopath + omegaconf + hydra-core + black + packaging + ] ++ optional-dependencies.all; + + passthru.optional-dependencies = optional-dependencies; + + # disable the tests for now until someone can check on a linux machine. + # doCheck = false; + + pythonImportsCheck = [ "detectron2" ]; + + meta = with lib; { + description = "Facebooks's next-generation platform for object detection, segmentation and other visual recognition tasks"; + homepage = "https://github.com/facebookresearch/detectron2"; + license = licenses.asl20; + maintainers = with maintainers; [ happysalada ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1e7191d7c83c..f26f813742a5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2571,6 +2571,8 @@ self: super: with self; { detect-secrets = callPackage ../development/python-modules/detect-secrets { }; + detectron2 = callPackage ../development/python-modules/detectron2 { }; + devito = callPackage ../development/python-modules/devito { }; devolo-home-control-api = callPackage ../development/python-modules/devolo-home-control-api { };