1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 joblib,
11 keras,
12 lz4,
13 pythonAtLeast,
14 distutils,
15
16 # tests
17 pytestCheckHook,
18}:
19
20buildPythonPackage rec {
21 pname = "mtcnn";
22 version = "1.0.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "ipazc";
27 repo = "mtcnn";
28 tag = "v${version}";
29 hash = "sha256-gp+jfa1arD3PpJpuRFKIUznV0Lyjt3DPn/HHUviDXhk=";
30 };
31
32 build-system = [ setuptools ];
33
34 dependencies = [
35 joblib
36 lz4
37 ]
38 ++ lib.optionals (pythonAtLeast "3.12") [
39 distutils
40 ];
41
42 pythonImportsCheck = [ "mtcnn" ];
43
44 nativeCheckInputs = [
45 keras
46 pytestCheckHook
47 ];
48
49 meta = {
50 description = "MTCNN face detection implementation for TensorFlow";
51 homepage = "https://github.com/ipazc/mtcnn";
52 changelog = "https://github.com/ipazc/mtcnn/releases/tag/v${version}";
53 license = lib.licenses.mit;
54 maintainers = with lib.maintainers; [ derdennisop ];
55 };
56}