diff --git a/tools/style_text_rec/arch/base_module.py b/tools/style_text_rec/arch/base_module.py index ea203f8291ae524c4c8fa82c7b295628b408e243..da2b6b834c6a86b1c3efeb5cef4cb9d02e44e405 100644 --- a/tools/style_text_rec/arch/base_module.py +++ b/tools/style_text_rec/arch/base_module.py @@ -11,9 +11,9 @@ # 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 functools import paddle import paddle.nn as nn + from arch.spectral_norm import spectral_norm diff --git a/tools/style_text_rec/arch/decoder.py b/tools/style_text_rec/arch/decoder.py index fe8c599cdf3b19193a956f39e22cc9f4f83423cf..36f07c5998a8f6b400997eacae0b44860312f432 100644 --- a/tools/style_text_rec/arch/decoder.py +++ b/tools/style_text_rec/arch/decoder.py @@ -13,6 +13,7 @@ # limitations under the License. import paddle import paddle.nn as nn + from arch.base_module import SNConv, SNConvTranspose, ResBlock diff --git a/tools/style_text_rec/arch/encoder.py b/tools/style_text_rec/arch/encoder.py index a304fcae135bb1d2839cc2d69c35f7a1a395e76c..b884cda2934477082a1ed98c94e33b736d1f96b4 100644 --- a/tools/style_text_rec/arch/encoder.py +++ b/tools/style_text_rec/arch/encoder.py @@ -13,6 +13,7 @@ # limitations under the License. import paddle import paddle.nn as nn + from arch.base_module import SNConv, SNConvTranspose, ResBlock diff --git a/tools/style_text_rec/arch/spectral_norm.py b/tools/style_text_rec/arch/spectral_norm.py index 349043ca663ae4533088e87eb041c5967958e1b0..21d0afc8d4a8fd4e2262db5c8461d6ffc3dadd45 100644 --- a/tools/style_text_rec/arch/spectral_norm.py +++ b/tools/style_text_rec/arch/spectral_norm.py @@ -11,10 +11,6 @@ # 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 math -import numpy as np - import paddle import paddle.nn as nn import paddle.nn.functional as F diff --git a/tools/style_text_rec/arch/style_text_rec.py b/tools/style_text_rec/arch/style_text_rec.py index 0686045dfddeb4fdfce2d31281436f36cde11bf6..599927ce3edefc90f14191ef3d29b1221355867e 100644 --- a/tools/style_text_rec/arch/style_text_rec.py +++ b/tools/style_text_rec/arch/style_text_rec.py @@ -11,9 +11,6 @@ # 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 -import cv2 -import math import paddle import paddle.nn as nn diff --git a/tools/style_text_rec/engine/corpus_generators.py b/tools/style_text_rec/engine/corpus_generators.py index 9f5758a5de9327ec18949737a8e17a67056f33c0..186d15f36d16971d9e7700535b50b1f724a80fe7 100644 --- a/tools/style_text_rec/engine/corpus_generators.py +++ b/tools/style_text_rec/engine/corpus_generators.py @@ -1,6 +1,18 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. +# +# 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 random -from PIL import Image, ImageDraw, ImageFont -import numpy as np + from utils.logging import get_logger diff --git a/tools/style_text_rec/engine/synthesisers.py b/tools/style_text_rec/engine/synthesisers.py index 4ef2d1c46fa560b3936e3daecdcee3a302cd0851..177e3e049a695ecd06f5d2271f21336dd4eff997 100644 --- a/tools/style_text_rec/engine/synthesisers.py +++ b/tools/style_text_rec/engine/synthesisers.py @@ -1,3 +1,16 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. +# +# 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 from utils.config import ArgsParser, load_config, override_config diff --git a/tools/style_text_rec/engine/text_drawers.py b/tools/style_text_rec/engine/text_drawers.py index c44c840c303ad40bda6a02b24093341e2af9e196..8aaac06ec50816bb6e2774972644c0a7dfb908c6 100644 --- a/tools/style_text_rec/engine/text_drawers.py +++ b/tools/style_text_rec/engine/text_drawers.py @@ -1,4 +1,3 @@ -import random from PIL import Image, ImageDraw, ImageFont import numpy as np from utils.logging import get_logger diff --git a/tools/style_text_rec/tools/synth_dataset.py b/tools/style_text_rec/tools/synth_dataset.py index 54f366a8cd28b56f154c0c002d7383b5d536cb7e..4a0e6d5e1f701c49558cfe1ea1df61e9b4180a89 100644 --- a/tools/style_text_rec/tools/synth_dataset.py +++ b/tools/style_text_rec/tools/synth_dataset.py @@ -1,3 +1,16 @@ +# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. +# +# 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 engine.synthesisers import DatasetSynthesiser diff --git a/tools/style_text_rec/utils/config.py b/tools/style_text_rec/utils/config.py index f11b7826bfc9c8971f2f40960455d855192def3e..d028b7c454e293630a15efd8873238fbada88e0a 100644 --- a/tools/style_text_rec/utils/config.py +++ b/tools/style_text_rec/utils/config.py @@ -13,7 +13,6 @@ # limitations under the License. import yaml import os -from collections import OrderedDict from argparse import ArgumentParser, RawDescriptionHelpFormatter diff --git a/tools/style_text_rec/utils/load_params.py b/tools/style_text_rec/utils/load_params.py index 943fd2624e6faf50a3f75d95a7ddb085ce954daf..be0561363eb21483d267ff6557c1d453d330c5f8 100644 --- a/tools/style_text_rec/utils/load_params.py +++ b/tools/style_text_rec/utils/load_params.py @@ -11,13 +11,7 @@ # 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 __future__ import absolute_import -from __future__ import division -from __future__ import print_function - import os - import paddle __all__ = ['load_dygraph_pretrain'] diff --git a/tools/style_text_rec/utils/logging.py b/tools/style_text_rec/utils/logging.py index 295900e8c7a0eec61ca4c97173f19a06ae1c559c..f700fe26bc9bfda21d39a0bddd89180f5de442ab 100644 --- a/tools/style_text_rec/utils/logging.py +++ b/tools/style_text_rec/utils/logging.py @@ -11,7 +11,6 @@ # 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 sys import logging