192 lines
5.8 KiB
Nix
192 lines
5.8 KiB
Nix
{
|
|
description = "Pre-built CPU-only OpenCV packages for Python. ";
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
pythonPackages = pkgs.python312Packages;
|
|
|
|
custom-opencv4 = pythonPackages.opencv4.override { enableGtk3 = true; };
|
|
|
|
lapx = pkgs.python3Packages.buildPythonPackage rec {
|
|
version = "0.5.11";
|
|
pname = "lapx";
|
|
pyproject = true;
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "rathaROG";
|
|
repo = "lapx";
|
|
rev = "be6f998e7cbe8746f75d9743a9de168d3788998f";
|
|
hash = "sha256-7TUorvC/h9myQ+ZMOPABfqXx4D0mKYB1meszhpIeWWs=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
propagatedBuildInputs = with pythonPackages; [ numpy ];
|
|
|
|
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.bsd2;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
};
|
|
|
|
ultralytics-thop = pkgs.python3Packages.buildPythonPackage rec {
|
|
version = "2.0.9";
|
|
pname = "ultralytics-htop";
|
|
pyproject = true;
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "ultralytics";
|
|
repo = "thop";
|
|
rev = "d304cebcc81f65a7b0d4304290f2abb100407ec0";
|
|
hash = "sha256-FzjxEk6yiG+IWwQEzsHcEAB4iVQT1QsyoGlG4I9lSwU=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
propagatedBuildInputs = with pythonPackages; [ numpy torch ];
|
|
|
|
nativeBuildInputs = with pythonPackages; [
|
|
setuptools
|
|
setuptools-scm
|
|
];
|
|
|
|
meta = with pkgs.lib; {
|
|
description = ''
|
|
THOP offers an intuitive API to profile PyTorch models
|
|
by calculating the number of MACs and parameters. This
|
|
functionality is crucial for assessing the computational
|
|
efficiency and memory footprint of deep learning models.
|
|
'';
|
|
homepage = "https://github.com/ultralytics/thop";
|
|
license = pkgs.lib.licenses.agpl3Only;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
};
|
|
|
|
ultralytics = pkgs.python3Packages.buildPythonPackage rec {
|
|
version = "8.3.13";
|
|
pname = "ultralytics";
|
|
pyproject = true;
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "ultralytics";
|
|
repo = "ultralytics";
|
|
rev = "15e6133534d82ec6845308f1e258d77c1b9bab36";
|
|
hash = "sha256-Wq2pCD0l0AbdQ2IPfEfxPffSxgv/5qFadB4BHAExEbU=";
|
|
fetchSubmodules = true;
|
|
};
|
|
# doCheck = false;
|
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
|
requests
|
|
pyyaml
|
|
torch
|
|
tqdm
|
|
psutil
|
|
torchvision
|
|
pandas
|
|
matplotlib
|
|
seaborn
|
|
py-cpuinfo
|
|
custom-opencv4
|
|
|
|
ultralytics-thop
|
|
];
|
|
|
|
pythonRelaxDeps = [ "torchvision" ];
|
|
pythonRemoveDeps = [ "opencv-python" ];
|
|
|
|
nativeBuildInputs = with pythonPackages; [
|
|
setuptools
|
|
setuptools-scm
|
|
pip
|
|
];
|
|
|
|
# nativeCheckInputs = [ ];
|
|
|
|
meta = with pkgs.lib; {
|
|
description = ''
|
|
Ultralytics YOLO for SOTA object detection,
|
|
multi-object tracking, instance segmentation,
|
|
pose estimation and image classification.
|
|
'';
|
|
homepage = "https://github.com/ultralytics/ultralytics";
|
|
license = pkgs.lib.licenses.agpl3Only;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
};
|
|
|
|
# boxmot
|
|
boxmot = pkgs.python3Packages.buildPythonPackage rec {
|
|
version = "0.5.11";
|
|
pname = "lapx";
|
|
pyproject = true;
|
|
src = pkgs.fetchFromGitHub {
|
|
owner = "mikel-brostrom";
|
|
repo = "boxmot";
|
|
rev = "5cbcd86b2716db5c70519b41e12907d351d7f5ff";
|
|
hash = "sha256-fb5qRdR75szHpFwil/uJz3/KAutYtrDVjyYJRZhI3pA=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
|
loguru
|
|
numpy
|
|
pandas
|
|
pyyaml
|
|
torch
|
|
yacs
|
|
torchvision
|
|
ftfy
|
|
filterpy
|
|
gdown
|
|
regex
|
|
scikit-learn
|
|
gitpython
|
|
custom-opencv4
|
|
pip
|
|
lapx
|
|
];
|
|
|
|
pythonRelaxDeps = [ "torchvision" ];
|
|
pythonRemoveDeps = [ "opencv-python" ];
|
|
|
|
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.agpl3Only;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
};
|
|
|
|
in {
|
|
packages = {
|
|
python312Packages.lapx = lapx;
|
|
python312Packages.ultralytics-thop = ultralytics-thop;
|
|
python312Packages.ultralytics = ultralytics;
|
|
python312Packages.boxmot = boxmot;
|
|
python312Packages.opencv4 = custom-opencv4;
|
|
};
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs =
|
|
[ (pkgs.python312.withPackages (ps: [ custom-opencv4 ])) ];
|
|
};
|
|
});
|
|
}
|