diff --git a/docs/conf.py b/docs/conf.py index b1fdd21..ff0390a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full diff --git a/setup.py b/setup.py index 21a925d..8d78d74 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from setuptools import setup, find_packages import os @@ -10,11 +24,13 @@ setup(name = "layoutparser", version = __version__, - author = "Zejiang Shen Ruochen Zhang", + author = "Zejiang Shen, Ruochen Zhang, and Layout Parser Model Contributors", + author_email = "layoutparser@gmail.com", license = "Apache-2.0", url = "https://github.com/Layout-Parser/layout-parser", package_dir = {"": "src"}, packages = find_packages("src"), + description = "A unified toolkit for Deep Learning Based Document Image Analysis", long_description=open("README.md", "r", encoding="utf-8").read(), long_description_content_type="text/markdown", python_requires='>=3.6', diff --git a/src/layoutparser/__init__.py b/src/layoutparser/__init__.py index 437eb7a..e587375 100644 --- a/src/layoutparser/__init__.py +++ b/src/layoutparser/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + __version__ = "0.2.0" import sys diff --git a/src/layoutparser/elements/__init__.py b/src/layoutparser/elements/__init__.py index c32b6b2..6df51d2 100644 --- a/src/layoutparser/elements/__init__.py +++ b/src/layoutparser/elements/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .base import BaseCoordElement, BaseLayoutElement from .layout_elements import ( Interval, diff --git a/src/layoutparser/elements/base.py b/src/layoutparser/elements/base.py index 88916c0..c78cd71 100644 --- a/src/layoutparser/elements/base.py +++ b/src/layoutparser/elements/base.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Dict, Dict, Any from abc import ABC, abstractmethod from copy import copy diff --git a/src/layoutparser/elements/errors.py b/src/layoutparser/elements/errors.py index 914ffbc..c5ef31d 100644 --- a/src/layoutparser/elements/errors.py +++ b/src/layoutparser/elements/errors.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + class NotSupportedShapeError(Exception): """For now (v0.2), if the created shape might be a polygon (shapes with more than 4 vertices), layoutparser will raise NotSupportedShapeError. It is expected to be fixed in the future versions. diff --git a/src/layoutparser/elements/layout.py b/src/layoutparser/elements/layout.py index b03b15c..174858c 100644 --- a/src/layoutparser/elements/layout.py +++ b/src/layoutparser/elements/layout.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout sParser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Union, Dict, Dict, Any, Optional from collections.abc import MutableSequence from copy import copy diff --git a/src/layoutparser/elements/layout_elements.py b/src/layoutparser/elements/layout_elements.py index 922229c..5bbe5b6 100644 --- a/src/layoutparser/elements/layout_elements.py +++ b/src/layoutparser/elements/layout_elements.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Union, Dict, Dict, Any, Optional, Tuple from collections.abc import Iterable from copy import copy diff --git a/src/layoutparser/elements/utils.py b/src/layoutparser/elements/utils.py index 46ce052..a6676a2 100644 --- a/src/layoutparser/elements/utils.py +++ b/src/layoutparser/elements/utils.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Union, Dict, Dict, Any, Optional, Tuple import numpy as np diff --git a/src/layoutparser/file_utils.py b/src/layoutparser/file_utils.py index d1568bb..b10a747 100644 --- a/src/layoutparser/file_utils.py +++ b/src/layoutparser/file_utils.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Some code are adapted from # https://github.com/huggingface/transformers/blob/master/src/transformers/file_utils.py diff --git a/src/layoutparser/io.py b/src/layoutparser/io.py index fad13b7..d823afb 100644 --- a/src/layoutparser/io.py +++ b/src/layoutparser/io.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import ast import json from typing import List, Union, Dict, Dict, Any diff --git a/src/layoutparser/models/__init__.py b/src/layoutparser/models/__init__.py index d636c5c..5a92e09 100644 --- a/src/layoutparser/models/__init__.py +++ b/src/layoutparser/models/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .detectron2.layoutmodel import Detectron2LayoutModel from .paddledetection.layoutmodel import PaddleDetectionLayoutModel from .effdet.layoutmodel import EfficientDetLayoutModel diff --git a/src/layoutparser/models/auto_layoutmodel.py b/src/layoutparser/models/auto_layoutmodel.py index 9e5fa59..3c35d99 100644 --- a/src/layoutparser/models/auto_layoutmodel.py +++ b/src/layoutparser/models/auto_layoutmodel.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Optional, Dict, Union, List from .detectron2.layoutmodel import Detectron2LayoutModel from .paddledetection.layoutmodel import PaddleDetectionLayoutModel diff --git a/src/layoutparser/models/base_catalog.py b/src/layoutparser/models/base_catalog.py index 3eb6ba5..104d014 100644 --- a/src/layoutparser/models/base_catalog.py +++ b/src/layoutparser/models/base_catalog.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from iopath.common.file_io import HTTPURLHandler from iopath.common.file_io import PathManager as PathManagerBase diff --git a/src/layoutparser/models/base_layoutmodel.py b/src/layoutparser/models/base_layoutmodel.py index 95883b3..495f34b 100644 --- a/src/layoutparser/models/base_layoutmodel.py +++ b/src/layoutparser/models/base_layoutmodel.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Optional, Tuple, Union, Dict from abc import ABC, abstractmethod diff --git a/src/layoutparser/models/detectron2/__init__.py b/src/layoutparser/models/detectron2/__init__.py index d7f1d60..eeb1839 100644 --- a/src/layoutparser/models/detectron2/__init__.py +++ b/src/layoutparser/models/detectron2/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from . import catalog as _UNUSED # A trick learned from # https://github.com/facebookresearch/detectron2/blob/62cf3a2b6840734d2717abdf96e2dd57ed6612a6/detectron2/checkpoint/__init__.py#L6 diff --git a/src/layoutparser/models/detectron2/catalog.py b/src/layoutparser/models/detectron2/catalog.py index 6e4feb1..12566b6 100644 --- a/src/layoutparser/models/detectron2/catalog.py +++ b/src/layoutparser/models/detectron2/catalog.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from iopath.common.file_io import PathHandler from ..base_catalog import PathManager diff --git a/src/layoutparser/models/detectron2/layoutmodel.py b/src/layoutparser/models/detectron2/layoutmodel.py index 5ffbd12..8552c56 100644 --- a/src/layoutparser/models/detectron2/layoutmodel.py +++ b/src/layoutparser/models/detectron2/layoutmodel.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import Union from PIL import Image import numpy as np diff --git a/src/layoutparser/models/effdet/__init__.py b/src/layoutparser/models/effdet/__init__.py index 6e78d19..211f474 100644 --- a/src/layoutparser/models/effdet/__init__.py +++ b/src/layoutparser/models/effdet/__init__.py @@ -1,2 +1,16 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from . import catalog as _UNUSED from .layoutmodel import EfficientDetLayoutModel diff --git a/src/layoutparser/models/effdet/catalog.py b/src/layoutparser/models/effdet/catalog.py index 74e2da1..d530cb3 100644 --- a/src/layoutparser/models/effdet/catalog.py +++ b/src/layoutparser/models/effdet/catalog.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from iopath.common.file_io import PathHandler from ..base_catalog import PathManager diff --git a/src/layoutparser/models/effdet/layoutmodel.py b/src/layoutparser/models/effdet/layoutmodel.py index b260598..8f25f6b 100644 --- a/src/layoutparser/models/effdet/layoutmodel.py +++ b/src/layoutparser/models/effdet/layoutmodel.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Optional, Union, Dict, Any, Tuple from PIL import Image diff --git a/src/layoutparser/models/model_config.py b/src/layoutparser/models/model_config.py index 82a98b6..03f0c1d 100644 --- a/src/layoutparser/models/model_config.py +++ b/src/layoutparser/models/model_config.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Inside layoutparser, we support the following formats for specifying layout model configs or weights: diff --git a/src/layoutparser/models/paddledetection/__init__.py b/src/layoutparser/models/paddledetection/__init__.py index 48b3ede..629619e 100644 --- a/src/layoutparser/models/paddledetection/__init__.py +++ b/src/layoutparser/models/paddledetection/__init__.py @@ -1,2 +1,17 @@ +# Copyright 2021 The Layout Parser team and Paddle Detection model +# contributors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from . import catalog as _UNUSED from .layoutmodel import PaddleDetectionLayoutModel diff --git a/src/layoutparser/models/paddledetection/catalog.py b/src/layoutparser/models/paddledetection/catalog.py index 6c738c8..b115850 100644 --- a/src/layoutparser/models/paddledetection/catalog.py +++ b/src/layoutparser/models/paddledetection/catalog.py @@ -1,3 +1,18 @@ +# Copyright 2021 The Layout Parser team and Paddle Detection model +# contributors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import logging from typing import Any, Optional diff --git a/src/layoutparser/models/paddledetection/layoutmodel.py b/src/layoutparser/models/paddledetection/layoutmodel.py index 82f15cd..f4edc33 100644 --- a/src/layoutparser/models/paddledetection/layoutmodel.py +++ b/src/layoutparser/models/paddledetection/layoutmodel.py @@ -1,3 +1,18 @@ +# Copyright 2021 The Layout Parser team and Paddle Detection model +# contributors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Union, Dict, Any, Tuple import os from functools import reduce diff --git a/src/layoutparser/ocr/__init__.py b/src/layoutparser/ocr/__init__.py index 4a45839..66efd76 100644 --- a/src/layoutparser/ocr/__init__.py +++ b/src/layoutparser/ocr/__init__.py @@ -1,2 +1,16 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .gcv_agent import GCVAgent, GCVFeatureType from .tesseract_agent import TesseractAgent, TesseractFeatureType \ No newline at end of file diff --git a/src/layoutparser/ocr/base.py b/src/layoutparser/ocr/base.py index 85b8dc5..4528d28 100644 --- a/src/layoutparser/ocr/base.py +++ b/src/layoutparser/ocr/base.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from abc import ABC, abstractmethod from enum import IntEnum diff --git a/src/layoutparser/ocr/gcv_agent.py b/src/layoutparser/ocr/gcv_agent.py index 82eff4d..62ad689 100644 --- a/src/layoutparser/ocr/gcv_agent.py +++ b/src/layoutparser/ocr/gcv_agent.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import io import os import json diff --git a/src/layoutparser/ocr/tesseract_agent.py b/src/layoutparser/ocr/tesseract_agent.py index 666cf9a..b7886b0 100644 --- a/src/layoutparser/ocr/tesseract_agent.py +++ b/src/layoutparser/ocr/tesseract_agent.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import io import csv import pickle diff --git a/src/layoutparser/visualization.py b/src/layoutparser/visualization.py index c458778..afac401 100644 --- a/src/layoutparser/visualization.py +++ b/src/layoutparser/visualization.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from typing import List, Union, Dict, Any, Tuple import functools import os diff --git a/tests/fixtures/io/generate_test_jsons.py b/tests/fixtures/io/generate_test_jsons.py index e0c5183..5d16c00 100644 --- a/tests/fixtures/io/generate_test_jsons.py +++ b/tests/fixtures/io/generate_test_jsons.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import json import numpy as np from layoutparser.elements import Interval, Rectangle, Quadrilateral, TextBlock, Layout diff --git a/tests/test_elements.py b/tests/test_elements.py index a13b23a..e504f91 100644 --- a/tests/test_elements.py +++ b/tests/test_elements.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import pytest import numpy as np import pandas as pd diff --git a/tests/test_io.py b/tests/test_io.py index 305094e..330294a 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import numpy as np from layoutparser.elements import Interval, Rectangle, Quadrilateral, TextBlock, Layout from layoutparser.io import load_json, load_dict, load_csv diff --git a/tests/test_model.py b/tests/test_model.py index 0096d19..42ace8b 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import pytest import cv2 diff --git a/tests/test_ocr.py b/tests/test_ocr.py index a05450d..0c42cfc 100644 --- a/tests/test_ocr.py +++ b/tests/test_ocr.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from layoutparser import ( GCVAgent, GCVFeatureType, diff --git a/tests/test_visualization.py b/tests/test_visualization.py index 3e6a242..eb357a3 100644 --- a/tests/test_visualization.py +++ b/tests/test_visualization.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from layoutparser.elements import * from layoutparser.ocr import * from layoutparser.visualization import * diff --git a/tests_deps/test_file_utils.py b/tests_deps/test_file_utils.py index 9652e16..1e43d1b 100644 --- a/tests_deps/test_file_utils.py +++ b/tests_deps/test_file_utils.py @@ -1,3 +1,17 @@ +# Copyright 2021 The Layout Parser team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import pytest from layoutparser import requires_backends