nixpkgs/pkgs/development/python-modules/easyocr/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.2 KiB
Nix
Raw Normal View History

2022-10-19 04:10:59 +00:00
{
lib,
buildPythonPackage,
fetchFromGitHub,
hdf5,
numpy,
onnx,
opencv4,
2022-10-19 04:10:59 +00:00
pillow,
pyaml,
pyclipper,
python-bidi,
pythonOlder,
scikit-image,
2022-10-19 04:10:59 +00:00
scipy,
shapely,
torch,
2022-10-19 04:10:59 +00:00
torchvision,
}:
buildPythonPackage rec {
pname = "easyocr";
version = "1.7.2";
format = "setuptools";
disabled = pythonOlder "3.7";
2022-10-19 04:10:59 +00:00
src = fetchFromGitHub {
owner = "JaidedAI";
repo = "EasyOCR";
rev = "refs/tags/v${version}";
hash = "sha256-9mrAxt2lphYtLW81lGO5SYHsnMnSA/VpHiY2NffD/Js=";
2022-10-19 04:10:59 +00:00
};
postPatch = ''
substituteInPlace requirements.txt \
--replace "opencv-python-headless" "" \
2022-10-19 04:10:59 +00:00
--replace "ninja" ""
'';
propagatedBuildInputs = [
hdf5
numpy
opencv4
2022-10-19 04:10:59 +00:00
pillow
pyaml
pyclipper
python-bidi
scikit-image
2022-10-19 04:10:59 +00:00
scipy
shapely
torch
torchvision
2022-10-19 04:10:59 +00:00
];
nativeCheckInputs = [ onnx ];
2022-10-19 04:10:59 +00:00
pythonImportsCheck = [ "easyocr" ];
2022-10-19 04:10:59 +00:00
meta = with lib; {
description = "Ready-to-use OCR with 80+ supported languages and all popular writing scripts";
mainProgram = "easyocr";
2022-10-19 04:10:59 +00:00
homepage = "https://github.com/JaidedAI/EasyOCR";
changelog = "https://github.com/JaidedAI/EasyOCR/releases/tag/v${version}";
2022-10-19 04:10:59 +00:00
license = licenses.asl20;
maintainers = with maintainers; [ dit7ya ];
};
}