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 stdenv,
23}:
24
25buildPythonPackage rec {
26 pname = "insightface";
27 version = "0.7.3";
28 pyproject = true;
29
30 disabled = pythonOlder "3.8";
31
32 src = fetchPypi {
33 inherit pname version;
34 hash = "sha256-8ZH3GWEuuzcBj0GTaBRQBUTND4bm/NZ2wCPzVMZo3fc=";
35 };
36
37 build-system = [ cython ];
38
39 dependencies = [
40 easydict
41 matplotlib
42 mxnet
43 numpy
44 onnx
45 onnxruntime
46 opencv4
47 scikit-learn
48 scikit-image
49 tensorboard
50 tqdm
51 albumentations
52 prettytable
53 ];
54
55 pythonImportsCheck = [
56 "insightface"
57 "insightface.app"
58 "insightface.data"
59 ];
60
61 passthru.tests.version = testers.testVersion {
62 package = insightface;
63 command = "insightface-cli --help";
64 # Doesn't support --version but we still want to make sure the cli is executable
65 # and returns the help output
66 version = "help";
67 };
68
69 doCheck = false; # Upstream has no tests
70
71 meta = {
72 description = "State-of-the-art 2D and 3D Face Analysis Project";
73 mainProgram = "insightface-cli";
74 homepage = "https://github.com/deepinsight/insightface";
75 license = lib.licenses.mit;
76 maintainers = with lib.maintainers; [ oddlama ];
77 # terminate called after throwing an instance of 'onnxruntime::OnnxRuntimeException'
78 broken = stdenv.system == "aarch64-linux";
79 };
80}