24 pname = "layoutparser";
26 optional-dependencies = {
31 gcv = [ google-cloud-vision ];
32 tesseract = [ pytesseract ];
43 # paddledetection = [ paddlepaddle ]
47 inherit pname version;
48 format = "setuptools";
50 src = fetchFromGitHub {
51 owner = "Layout-Parser";
52 repo = "layout-parser";
53 rev = "refs/tags/v${version}";
54 hash = "sha256-qBzcIUmgnGy/Xn/B+7UrLrRhCvCkapL+ymqGS2sMVgA=";
58 substituteInPlace setup.py \
59 --replace "opencv-python" "opencv"
62 propagatedBuildInputs = [
74 pythonImportsCheck = [ "layoutparser" ];
76 nativeCheckInputs = [ pytestCheckHook ] ++ optional-dependencies.ocr;
79 "test_PaddleDetectionModel" # requires paddlepaddle not yet packaged
80 # requires detectron2 not yet packaged
81 "test_Detectron2Model"
83 # requires effdet (disable for now until effdet builds on darwin)
85 # problems with google-cloud-vision
86 # AttributeError: module 'google.cloud.vision' has no attribute 'types'
89 # - Failed: DID NOT RAISE <class 'ImportError'>
90 "test_when_backends_are_not_loaded"
94 "tests_deps/test_only_detectron2.py" # requires detectron2 not yet packaged
95 "tests_deps/test_only_effdet.py" # requires effdet (disable for now until effdet builds on darwin)
96 "tests_deps/test_only_paddledetection.py" # requires paddlepaddle not yet packaged
99 optional-dependencies = optional-dependencies;
102 description = "Unified toolkit for Deep Learning Based Document Image Analysis";
103 homepage = "https://github.com/Layout-Parser/layout-parser";
104 changelog = "https://github.com/Layout-Parser/layout-parser/releases/tag/v${version}";
105 license = licenses.asl20;
106 maintainers = with maintainers; [ happysalada ];