2022-10-19 04:10:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hdf5,
|
|
|
|
numpy,
|
2023-06-09 21:13:04 +00:00
|
|
|
onnx,
|
2023-10-12 16:31:24 +00:00
|
|
|
opencv4,
|
2022-10-19 04:10:59 +00:00
|
|
|
pillow,
|
|
|
|
pyaml,
|
|
|
|
pyclipper,
|
|
|
|
python-bidi,
|
2023-06-09 21:13:04 +00:00
|
|
|
pythonOlder,
|
2023-05-14 11:04:10 +00:00
|
|
|
scikit-image,
|
2022-10-19 04:10:59 +00:00
|
|
|
scipy,
|
|
|
|
shapely,
|
2023-06-09 21:13:04 +00:00
|
|
|
torch,
|
2022-10-19 04:10:59 +00:00
|
|
|
torchvision,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "easyocr";
|
2024-09-24 15:25:36 +00:00
|
|
|
version = "1.7.2";
|
2023-06-09 21:13:04 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-10-19 04:10:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JaidedAI";
|
|
|
|
repo = "EasyOCR";
|
2023-06-09 21:11:07 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-24 15:25:36 +00:00
|
|
|
hash = "sha256-9mrAxt2lphYtLW81lGO5SYHsnMnSA/VpHiY2NffD/Js=";
|
2022-10-19 04:10:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
2023-06-09 21:17:42 +00:00
|
|
|
--replace "opencv-python-headless" "" \
|
2022-10-19 04:10:59 +00:00
|
|
|
--replace "ninja" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
hdf5
|
|
|
|
numpy
|
2023-10-12 16:31:24 +00:00
|
|
|
opencv4
|
2022-10-19 04:10:59 +00:00
|
|
|
pillow
|
|
|
|
pyaml
|
|
|
|
pyclipper
|
2023-06-09 21:13:04 +00:00
|
|
|
python-bidi
|
|
|
|
scikit-image
|
2022-10-19 04:10:59 +00:00
|
|
|
scipy
|
|
|
|
shapely
|
2023-06-09 21:13:04 +00:00
|
|
|
torch
|
|
|
|
torchvision
|
2022-10-19 04:10:59 +00:00
|
|
|
];
|
|
|
|
|
2023-06-09 21:13:04 +00:00
|
|
|
nativeCheckInputs = [ onnx ];
|
2022-10-19 04:10:59 +00:00
|
|
|
|
2023-06-09 21:13:04 +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";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "easyocr";
|
2022-10-19 04:10:59 +00:00
|
|
|
homepage = "https://github.com/JaidedAI/EasyOCR";
|
2023-06-09 21:11:07 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|