nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 disabledTests = [
50 # Failing since keras 3.13.0.
51 # ValueError: Exception encountered when calling Conv2D.call().
52 # The convolution operation resulted in an empty output. Output shape: (0, 48, 48, 3).
53 # This can happen if the input is too small for the given kernel size, strides, dilation rate,
54 # and padding mode. Please check the input shape and convolution parameters.
55 "test_detect_no_faces"
56 ];
57
58 meta = {
59 description = "MTCNN face detection implementation for TensorFlow";
60 homepage = "https://github.com/ipazc/mtcnn";
61 changelog = "https://github.com/ipazc/mtcnn/releases/tag/v${version}";
62 license = lib.licenses.mit;
63 maintainers = with lib.maintainers; [ derdennisop ];
64 };
65}