Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
2.5 kB · 111 lines
Nix
at flake-libs
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112{ lib, buildPythonPackage, fetchFromGitHub, attrdict, beautifulsoup4, cython, fire, fonttools, lmdb, lxml, numpy, opencv-python, openpyxl, pdf2docx, pillow, pyclipper, pymupdf, python-docx, rapidfuzz, scikit-image, shapely, tqdm, paddlepaddle, lanms-neo, polygon3,}:
let version = "2.9.1";inbuildPythonPackage rec { pname = "paddleocr"; inherit version; format = "setuptools";
src = fetchFromGitHub { owner = "PaddlePaddle"; repo = "PaddleOCR"; tag = "v${version}"; hash = "sha256-QCddxgVdLaAJLfKCy+tnQsxownfl1Uv0TXhFRiFi9cY="; };
patches = [ # The `ppocr.data.imaug` re-exports the `IaaAugment` and `CopyPaste` # classes. These classes depend on the `imgaug` package which is # unmaintained and has been removed from nixpkgs. # # The image OCR feature of PaddleOCR doesn't use these classes though, so # they work even after stripping the the `IaaAugment` and `CopyPaste` # exports. It probably breaks some of the OCR model creation tooling that # PaddleOCR provides, however. ./remove-import-imaug.patch ];
# trying to relax only pymupdf makes the whole build fail pythonRelaxDeps = true; pythonRemoveDeps = [ "imgaug" "visualdl" "opencv-contrib-python" ];
propagatedBuildInputs = [ attrdict beautifulsoup4 cython fire fonttools lmdb lxml numpy opencv-python openpyxl pdf2docx pillow pyclipper pymupdf python-docx rapidfuzz scikit-image shapely tqdm paddlepaddle lanms-neo polygon3 ];
# TODO: The tests depend, among possibly other things, on `cudatoolkit`. # But Cudatoolkit fails to install. # preCheck = "export HOME=$TMPDIR"; # nativeCheckInputs = with pkgs; [ which cudatoolkit ]; doCheck = false;
meta = with lib; { homepage = "https://github.com/PaddlePaddle/PaddleOCR"; license = licenses.asl20; description = "Multilingual OCR toolkits based on PaddlePaddle"; longDescription = '' PaddleOCR aims to create multilingual, awesome, leading, and practical OCR tools that help users train better models and apply them into practice. ''; changelog = "https://github.com/PaddlePaddle/PaddleOCR/releases/tag/${src.tag}"; maintainers = with maintainers; [ happysalada ]; platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; };}