2022-10-19 06:10:59 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, hdf5
|
|
|
|
, numpy
|
2023-06-09 23:13:04 +02:00
|
|
|
, onnx
|
2022-10-19 06:10:59 +02:00
|
|
|
, opencv3
|
|
|
|
, pillow
|
|
|
|
, pyaml
|
|
|
|
, pyclipper
|
|
|
|
, python-bidi
|
2023-06-09 23:13:04 +02:00
|
|
|
, pythonOlder
|
2023-05-14 13:04:10 +02:00
|
|
|
, scikit-image
|
2022-10-19 06:10:59 +02:00
|
|
|
, scipy
|
|
|
|
, shapely
|
2023-06-09 23:13:04 +02:00
|
|
|
, torch
|
2022-10-19 06:10:59 +02:00
|
|
|
, torchvision
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "easyocr";
|
2023-06-09 23:17:42 +02:00
|
|
|
version = "1.7.0";
|
2023-06-09 23:13:04 +02:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-10-19 06:10:59 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JaidedAI";
|
|
|
|
repo = "EasyOCR";
|
2023-06-09 23:11:07 +02:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-06-09 23:17:42 +02:00
|
|
|
hash = "sha256-01Exz55eTIO/xzdq/dzV+ELkU75hpxe/EbjIqLBA8h0=";
|
2022-10-19 06:10:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
2023-06-09 23:17:42 +02:00
|
|
|
--replace "opencv-python-headless" "" \
|
2022-10-19 06:10:59 +02:00
|
|
|
--replace "ninja" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
hdf5
|
|
|
|
numpy
|
|
|
|
opencv3
|
|
|
|
pillow
|
|
|
|
pyaml
|
|
|
|
pyclipper
|
2023-06-09 23:13:04 +02:00
|
|
|
python-bidi
|
|
|
|
scikit-image
|
2022-10-19 06:10:59 +02:00
|
|
|
scipy
|
|
|
|
shapely
|
2023-06-09 23:13:04 +02:00
|
|
|
torch
|
|
|
|
torchvision
|
2022-10-19 06:10:59 +02:00
|
|
|
];
|
|
|
|
|
2023-06-09 23:13:04 +02:00
|
|
|
nativeCheckInputs = [
|
|
|
|
onnx
|
|
|
|
];
|
2022-10-19 06:10:59 +02:00
|
|
|
|
2023-06-09 23:13:04 +02:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"easyocr"
|
|
|
|
];
|
2022-10-19 06:10:59 +02:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Ready-to-use OCR with 80+ supported languages and all popular writing scripts";
|
|
|
|
homepage = "https://github.com/JaidedAI/EasyOCR";
|
2023-06-09 23:11:07 +02:00
|
|
|
changelog = "https://github.com/JaidedAI/EasyOCR/releases/tag/v${version}";
|
2022-10-19 06:10:59 +02:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dit7ya ];
|
|
|
|
};
|
|
|
|
}
|