depot/third_party/nixpkgs/pkgs/development/python-modules/mtcnn/default.nix
Default email 555cd8a8f9 Project import generated by Copybara.
GitOrigin-RevId: 5633bcff0c6162b9e4b5f1264264611e950c8ec7
2024-10-09 18:51:18 +02:00

53 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
opencv4,
pytestCheckHook,
pythonOlder,
setuptools,
tensorflow,
}:
buildPythonPackage {
pname = "mtcnn";
version = "0.1.1";
pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "ipazc";
repo = "mtcnn";
# No tags / releases; using commit: https://github.com/ipazc/mtcnn/commit/3208d443a8f01d317c65d7c97a03bc0a6143c41d
rev = "3208d443a8f01d317c65d7c97a03bc0a6143c41d";
hash = "sha256-GXUrLJ5XD6V2hT/gjyYSuh/CMMw2xIXKBsYFvQmbLYs=";
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail "setup, setuptools" "setup, find_packages"\
--replace-fail "setuptools.find_packages" "find_packages"\
--replace-fail "opencv-python>=4.1.0" ""\
--replace-fail "keras>=2.0.0" ""\
--replace-fail "tests_require=['nose']," ""
'';
build-system = [ setuptools ];
dependencies = [
opencv4
tensorflow
];
pythonImportsCheck = [ "mtcnn" ];
nativeCheckInputs = [ pytestCheckHook ];
meta = {
description = "MTCNN face detection implementation for TensorFlow";
homepage = "https://github.com/ipazc/mtcnn";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ derdennisop ];
};
}