about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/python-modules/norfair/default.nix69
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/norfair/default.nix b/pkgs/development/python-modules/norfair/default.nix
new file mode 100644
index 000000000000..17c4e3553531
--- /dev/null
+++ b/pkgs/development/python-modules/norfair/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, poetry-core
+, filterpy
+, importlib-metadata
+, numpy
+, rich
+, scipy
+, motmetrics
+, opencv4
+, pytestCheckHook
+, pythonRelaxDepsHook
+}:
+
+buildPythonPackage rec {
+  pname = "norfair";
+  version = "2.2.0";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "tryolabs";
+    repo = "norfair";
+    rev = "v${version}";
+    hash = "sha256-aKB5TYSLW7FOXIy9u2hK7px6eEmIQdKPrhChKaU1uYs=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+    pythonRelaxDepsHook
+  ];
+
+  pythonRelaxDeps = [
+    "rich"
+  ];
+
+  propagatedBuildInputs = [
+    filterpy
+    importlib-metadata
+    numpy
+    rich
+    scipy
+  ];
+
+  passthru.optional-dependencies = {
+    metrics = [
+      motmetrics
+    ];
+    video = [
+      opencv4
+    ];
+  };
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "norfair"
+  ];
+
+  meta = with lib; {
+    description = "Lightweight Python library for adding real-time multi-object tracking to any detector";
+    changelog = "https://github.com/tryolabs/norfair/releases/tag/v${version}";
+    homepage = "https://github.com/tryolabs/norfair";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ fleaz ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index bc0fd5bc4d1a..4dc27ef59a4a 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -8437,6 +8437,8 @@ self: super: with self; {
 
   noiseprotocol = callPackage ../development/python-modules/noiseprotocol { };
 
+  norfair = callPackage ../development/python-modules/norfair { };
+
   normality = callPackage ../development/python-modules/normality { };
 
   nose = callPackage ../development/python-modules/nose { };