1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 filterpy,
7 importlib-metadata,
8 numpy,
9 rich,
10 scipy,
11 motmetrics,
12 opencv4,
13 pytestCheckHook,
14 pythonRelaxDepsHook,
15}:
16
17buildPythonPackage rec {
18 pname = "norfair";
19 version = "2.2.0";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "tryolabs";
24 repo = "norfair";
25 rev = "v${version}";
26 hash = "sha256-aKB5TYSLW7FOXIy9u2hK7px6eEmIQdKPrhChKaU1uYs=";
27 };
28
29 nativeBuildInputs = [
30 poetry-core
31 pythonRelaxDepsHook
32 ];
33
34 pythonRelaxDeps = [ "rich" ];
35
36 propagatedBuildInputs = [
37 filterpy
38 importlib-metadata
39 numpy
40 rich
41 scipy
42 ];
43
44 passthru.optional-dependencies = {
45 metrics = [ motmetrics ];
46 video = [ opencv4 ];
47 };
48
49 nativeCheckInputs = [ pytestCheckHook ];
50
51 pythonImportsCheck = [ "norfair" ];
52
53 meta = with lib; {
54 description = "Lightweight Python library for adding real-time multi-object tracking to any detector";
55 changelog = "https://github.com/tryolabs/norfair/releases/tag/v${version}";
56 homepage = "https://github.com/tryolabs/norfair";
57 license = licenses.bsd3;
58 maintainers = with maintainers; [ fleaz ];
59 };
60}