ttaenc: init at 3.4.1 (#238757)
[NixPkgs.git] / pkgs / development / python-modules / easyocr / default.nix
bloba75434c018aec1d3b2fe0308a4660ea225982b5c
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   setuptools,
6   hdf5,
7   numpy,
8   opencv-python-headless,
9   pillow,
10   pyaml,
11   pyclipper,
12   python-bidi,
13   pythonOlder,
14   scikit-image,
15   scipy,
16   shapely,
17   torch,
18   torchvision,
19   python,
22 buildPythonPackage rec {
23   pname = "easyocr";
24   version = "1.7.2";
25   pyproject = true;
27   disabled = pythonOlder "3.7";
29   src = fetchFromGitHub {
30     owner = "JaidedAI";
31     repo = "EasyOCR";
32     rev = "refs/tags/v${version}";
33     hash = "sha256-9mrAxt2lphYtLW81lGO5SYHsnMnSA/VpHiY2NffD/Js=";
34   };
36   build-system = [
37     setuptools
38   ];
40   pythonRelaxDeps = [
41     "torchvision"
42   ];
44   pythonRemoveDeps = [
45     "ninja"
46   ];
48   dependencies = [
49     hdf5
50     numpy
51     opencv-python-headless
52     pillow
53     pyaml
54     pyclipper
55     python-bidi
56     scikit-image
57     scipy
58     shapely
59     torch
60     torchvision
61   ];
63   checkPhase = ''
64     runHook preCheck
66     export HOME="$(mktemp -d)"
67     pushd unit_test
68     ${python.interpreter} run_unit_test.py --easyocr "$out/${python.sitePackages}/easyocr"
69     popd
71     runHook postCheck
72   '';
74   # downloads detection model from the internet
75   doCheck = false;
77   pythonImportsCheck = [ "easyocr" ];
79   meta = with lib; {
80     description = "Ready-to-use OCR with 80+ supported languages and all popular writing scripts";
81     mainProgram = "easyocr";
82     homepage = "https://github.com/JaidedAI/EasyOCR";
83     changelog = "https://github.com/JaidedAI/EasyOCR/releases/tag/v${version}";
84     license = licenses.asl20;
85     maintainers = with maintainers; [ dit7ya ];
86   };