Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / easyocr / default.nix
blob18d76f8e6766396bd3fcdb46340dbaaea5da8a15
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , hdf5
5 , numpy
6 , onnx
7 , opencv4
8 , pillow
9 , pyaml
10 , pyclipper
11 , python-bidi
12 , pythonOlder
13 , scikit-image
14 , scipy
15 , shapely
16 , torch
17 , torchvision
20 buildPythonPackage rec {
21   pname = "easyocr";
22   version = "1.7.1";
23   format = "setuptools";
25   disabled = pythonOlder "3.7";
27   src = fetchFromGitHub {
28     owner = "JaidedAI";
29     repo = "EasyOCR";
30     rev = "refs/tags/v${version}";
31     hash = "sha256-EiiJ2LJ3uYIvgPd2y25MraV5kTa47JalDR7SLbkM9UI=";
32   };
34   postPatch = ''
35     substituteInPlace requirements.txt \
36       --replace "opencv-python-headless" "" \
37       --replace "ninja" ""
38   '';
40   propagatedBuildInputs = [
41     hdf5
42     numpy
43     opencv4
44     pillow
45     pyaml
46     pyclipper
47     python-bidi
48     scikit-image
49     scipy
50     shapely
51     torch
52     torchvision
53   ];
55   nativeCheckInputs = [
56     onnx
57   ];
59   pythonImportsCheck = [
60     "easyocr"
61   ];
63   meta = with lib; {
64     description = "Ready-to-use OCR with 80+ supported languages and all popular writing scripts";
65     mainProgram = "easyocr";
66     homepage = "https://github.com/JaidedAI/EasyOCR";
67     changelog = "https://github.com/JaidedAI/EasyOCR/releases/tag/v${version}";
68     license = licenses.asl20;
69     maintainers = with maintainers; [ dit7ya ];
70   };