summary refs log tree commit diff
path: root/pkgs/development/python-modules/invisible-watermark/default.nix
blob: 3c48dcc4d60bed1edf91fdad81617736fb1e8836 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, opencv4
, torch
, onnx
, onnxruntime
, pillow
, pywavelets
, numpy
}:

buildPythonPackage rec {
  pname = "invisible-watermark";
  version = "0.1.5";
  format = "setuptools";
  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "ShieldMnt";
    repo = "invisible-watermark";
    rev = version;
    hash = "sha256-NGDPEETuM7rYbo8kXYoRWLJWpa/lWLKEvaaiDzSWYZ4=";
  };

  propagatedBuildInputs = [
    opencv4
    torch
    onnx
    onnxruntime
    pillow
    pywavelets
    numpy
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace 'opencv-python>=4.1.0.25' 'opencv'
  '';

  pythonImportsCheck = [ "imwatermark" ];

  meta = with lib; {
    description = "A library for creating and decoding invisible image watermarks";
    homepage = "https://github.com/ShieldMnt/invisible-watermark";
    license = licenses.mit;
    maintainers = with maintainers; [ Luflosi ];
  };
}