1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, opencv4
6, torch
7, onnx
8, onnxruntime
9, pillow
10, pywavelets
11, numpy
12}:
13
14buildPythonPackage rec {
15 pname = "invisible-watermark";
16 version = "0.1.5";
17 format = "setuptools";
18 disabled = pythonOlder "3.6";
19
20 src = fetchFromGitHub {
21 owner = "ShieldMnt";
22 repo = "invisible-watermark";
23 rev = version;
24 hash = "sha256-NGDPEETuM7rYbo8kXYoRWLJWpa/lWLKEvaaiDzSWYZ4=";
25 };
26
27 propagatedBuildInputs = [
28 opencv4
29 torch
30 onnx
31 onnxruntime
32 pillow
33 pywavelets
34 numpy
35 ];
36
37 postPatch = ''
38 substituteInPlace setup.py \
39 --replace 'opencv-python>=4.1.0.25' 'opencv'
40 '';
41
42 pythonImportsCheck = [ "imwatermark" ];
43
44 meta = with lib; {
45 description = "A library for creating and decoding invisible image watermarks";
46 homepage = "https://github.com/ShieldMnt/invisible-watermark";
47 license = licenses.mit;
48 maintainers = with maintainers; [ Luflosi ];
49 };
50}