2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
hdf5,
|
|
|
|
numpy,
|
|
|
|
onnx,
|
|
|
|
opencv4,
|
|
|
|
pillow,
|
|
|
|
pyaml,
|
|
|
|
pyclipper,
|
|
|
|
python-bidi,
|
|
|
|
pythonOlder,
|
|
|
|
scikit-image,
|
|
|
|
scipy,
|
|
|
|
shapely,
|
|
|
|
torch,
|
|
|
|
torchvision,
|
2022-12-02 08:20:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "easyocr";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.7.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "JaidedAI";
|
|
|
|
repo = "EasyOCR";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-EiiJ2LJ3uYIvgPd2y25MraV5kTa47JalDR7SLbkM9UI=";
|
2022-12-02 08:20:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
2023-07-15 17:15:38 +00:00
|
|
|
--replace "opencv-python-headless" "" \
|
2022-12-02 08:20:57 +00:00
|
|
|
--replace "ninja" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
hdf5
|
|
|
|
numpy
|
2023-11-16 04:20:00 +00:00
|
|
|
opencv4
|
2022-12-02 08:20:57 +00:00
|
|
|
pillow
|
|
|
|
pyaml
|
|
|
|
pyclipper
|
2023-07-15 17:15:38 +00:00
|
|
|
python-bidi
|
|
|
|
scikit-image
|
2022-12-02 08:20:57 +00:00
|
|
|
scipy
|
|
|
|
shapely
|
2023-07-15 17:15:38 +00:00
|
|
|
torch
|
|
|
|
torchvision
|
2022-12-02 08:20:57 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ onnx ];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "easyocr" ];
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Ready-to-use OCR with 80+ supported languages and all popular writing scripts";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "easyocr";
|
2022-12-02 08:20:57 +00:00
|
|
|
homepage = "https://github.com/JaidedAI/EasyOCR";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/JaidedAI/EasyOCR/releases/tag/v${version}";
|
2022-12-02 08:20:57 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dit7ya ];
|
|
|
|
};
|
|
|
|
}
|