1{
2 lib,
3 albumentations,
4 buildPythonPackage,
5 cython,
6 easydict,
7 fetchPypi,
8 insightface,
9 matplotlib,
10 mxnet,
11 numpy,
12 onnx,
13 onnxruntime,
14 opencv4,
15 prettytable,
16 pythonOlder,
17 scikit-image,
18 scikit-learn,
19 tensorboard,
20 testers,
21 tqdm,
22}:
23
24buildPythonPackage rec {
25 pname = "insightface";
26 version = "0.7.3";
27 format = "setuptools";
28
29 disabled = pythonOlder "3.8";
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-8ZH3GWEuuzcBj0GTaBRQBUTND4bm/NZ2wCPzVMZo3fc=";
34 };
35
36 nativeBuildInputs = [ cython ];
37
38 propagatedBuildInputs = [
39 easydict
40 matplotlib
41 mxnet
42 numpy
43 onnx
44 onnxruntime
45 opencv4
46 scikit-learn
47 scikit-image
48 tensorboard
49 tqdm
50 albumentations
51 prettytable
52 ];
53
54 pythonImportsCheck = [
55 "insightface"
56 "insightface.app"
57 "insightface.data"
58 ];
59
60 passthru.tests.version = testers.testVersion {
61 package = insightface;
62 command = "insightface-cli --help";
63 # Doesn't support --version but we still want to make sure the cli is executable
64 # and returns the help output
65 version = "help";
66 };
67
68 doCheck = false; # Upstream has no tests
69
70 meta = with lib; {
71 description = "State-of-the-art 2D and 3D Face Analysis Project";
72 mainProgram = "insightface-cli";
73 homepage = "https://github.com/deepinsight/insightface";
74 license = licenses.mit;
75 maintainers = with maintainers; [ oddlama ];
76 };
77}