diff --git a/PaddleCV/image_classification/dist_train/batch_merge.py b/PaddleCV/image_classification/dist_train/batch_merge.py index ee365de38494723a7d7542bd162169c4211ee63e..01bb9ab0a64542c76005a6f9aba2a8e9f176d4bb 100644 --- a/PaddleCV/image_classification/dist_train/batch_merge.py +++ b/PaddleCV/image_classification/dist_train/batch_merge.py @@ -1,3 +1,17 @@ +#copyright (c) 2019 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 paddle.fluid as fluid import numpy as np diff --git a/PaddleCV/image_classification/dist_train/dist_utils.py b/PaddleCV/image_classification/dist_train/dist_utils.py index 823055e06fbc5b396c3c4ef00bb150d18221f6e3..58355a6696b3c055d94047e1fe3bd865629f498e 100644 --- a/PaddleCV/image_classification/dist_train/dist_utils.py +++ b/PaddleCV/image_classification/dist_train/dist_utils.py @@ -1,3 +1,17 @@ +#copyright (c) 2019 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 import paddle.fluid as fluid diff --git a/PaddleCV/image_classification/dist_train/env.py b/PaddleCV/image_classification/dist_train/env.py index f85297e4d3e24322176ad25ee34366f446e18896..08db25bd9f56139d793714a62fa3df03b255ebcd 100644 --- a/PaddleCV/image_classification/dist_train/env.py +++ b/PaddleCV/image_classification/dist_train/env.py @@ -1,3 +1,17 @@ +#copyright (c) 2019 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 diff --git a/PaddleCV/image_classification/eval.py b/PaddleCV/image_classification/eval.py index 06b3e587ae726efb9c6a58a931916048eb122cc5..8db943bff5660298c6989ef819690fdbfe16af44 100644 --- a/PaddleCV/image_classification/eval.py +++ b/PaddleCV/image_classification/eval.py @@ -1,19 +1,35 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + import os -import numpy as np import time import sys -import paddle -import paddle.fluid as fluid -import reader_cv2 as reader +import math +import numpy as np import argparse import functools + +import paddle +import paddle.fluid as fluid +import reader_cv2 as reader import models from utils.learning_rate import cosine_decay from utils.utility import add_arguments, print_arguments -import math parser = argparse.ArgumentParser(description=__doc__) add_arg = functools.partial(add_arguments, argparser=parser) diff --git a/PaddleCV/image_classification/fast_imagenet/datasets.py b/PaddleCV/image_classification/fast_imagenet/datasets.py index 866e58db3d5074a19e2989a13e085cae4daba36b..d8083ff135764153b0e56f0a36813fd47e3e5178 100644 --- a/PaddleCV/image_classification/fast_imagenet/datasets.py +++ b/PaddleCV/image_classification/fast_imagenet/datasets.py @@ -1,3 +1,17 @@ +#copyright (c) 2019 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 PIL import Image import os diff --git a/PaddleCV/image_classification/fast_imagenet/reader.py b/PaddleCV/image_classification/fast_imagenet/reader.py index 9d277322ae5b8f9718720e3eb76bd04cb02d648a..926bcc47d8ec103a39b483b37d19b0196e1960df 100644 --- a/PaddleCV/image_classification/fast_imagenet/reader.py +++ b/PaddleCV/image_classification/fast_imagenet/reader.py @@ -1,10 +1,25 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division -import os +from __future__ import print_function +import os import numpy as np import math import random - import pickle from tqdm import tqdm import time diff --git a/PaddleCV/image_classification/fast_imagenet/tools/resize.py b/PaddleCV/image_classification/fast_imagenet/tools/resize.py index 0cb7fcde3b247ec8af1cb8287e092b2c746a5701..7eab28c532613431e6eb1abc18b40df9ba92d2da 100644 --- a/PaddleCV/image_classification/fast_imagenet/tools/resize.py +++ b/PaddleCV/image_classification/fast_imagenet/tools/resize.py @@ -1,8 +1,24 @@ +#copyright (c) 2019 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 PIL import Image from pathlib import Path from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor from functools import partial + import multiprocessing + cpus = multiprocessing.cpu_count() cpus = min(36,cpus) @@ -41,4 +57,4 @@ for sz in szs: for ds in ("validation", "train"): print(PATH/ds) - resize_imgs(PATH/ds) \ No newline at end of file + resize_imgs(PATH/ds) diff --git a/PaddleCV/image_classification/fast_imagenet/train.py b/PaddleCV/image_classification/fast_imagenet/train.py index 2479d65ce56c2591bcf831ab3bb45f4d4f508e1a..e7bdb4658afa304273f6821b1d34c39b851ed32a 100644 --- a/PaddleCV/image_classification/fast_imagenet/train.py +++ b/PaddleCV/image_classification/fast_imagenet/train.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. +# Copyright (c) 2019 PaddlePaddle Authors. 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. diff --git a/PaddleCV/image_classification/fast_imagenet/transforms.py b/PaddleCV/image_classification/fast_imagenet/transforms.py index ad9707bacfbb71b9801b05642415d80f35ac5110..eb3effd39194915678d3467b9cbabd2c291a0f79 100644 --- a/PaddleCV/image_classification/fast_imagenet/transforms.py +++ b/PaddleCV/image_classification/fast_imagenet/transforms.py @@ -1,4 +1,21 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division +from __future__ import print_function + import math import random from PIL import Image diff --git a/PaddleCV/image_classification/infer.py b/PaddleCV/image_classification/infer.py index ac788c89109b40c5d3397564c01b0729c93bfcff..f60073f3c915be62a37db4b6cb96e4bedfd7ce96 100644 --- a/PaddleCV/image_classification/infer.py +++ b/PaddleCV/image_classification/infer.py @@ -1,19 +1,35 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + import os -import numpy as np import time import sys +import math +import numpy as np +import argparse +import functools + import paddle import paddle.fluid as fluid import reader_cv2 as reader -import argparse -import functools import models import utils from utils.utility import add_arguments,print_arguments -import math parser = argparse.ArgumentParser(description=__doc__) # yapf: disable diff --git a/PaddleCV/image_classification/models/alexnet.py b/PaddleCV/image_classification/models/alexnet.py index f063c4d6deb88905aaa5f8a5eba59903f58293e8..dcc68ec0c5e19f67fc15bfd9094af3ab1e1320b2 100644 --- a/PaddleCV/image_classification/models/alexnet.py +++ b/PaddleCV/image_classification/models/alexnet.py @@ -1,9 +1,25 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + +import math + import paddle import paddle.fluid as fluid -import math __all__ = ['AlexNet'] diff --git a/PaddleCV/image_classification/models/dpn.py b/PaddleCV/image_classification/models/dpn.py index 7f759b3bb6bfa9c866e129ac93ab2c6a9cf4168c..bbc19aea745af6490c4e9bcc4b4d0c952ba7d217 100644 --- a/PaddleCV/image_classification/models/dpn.py +++ b/PaddleCV/image_classification/models/dpn.py @@ -1,12 +1,28 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + import os import numpy as np import time import sys -import paddle.fluid as fluid import math + +import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr __all__ = ["DPN", "DPN68", "DPN92", "DPN98", "DPN107", "DPN131"] diff --git a/PaddleCV/image_classification/models/googlenet.py b/PaddleCV/image_classification/models/googlenet.py index bd9040c53e61a48d9f5bff6683bec961d3f95583..9bb3ad6d83cff48332d6bb27482bd2594fb13144 100644 --- a/PaddleCV/image_classification/models/googlenet.py +++ b/PaddleCV/image_classification/models/googlenet.py @@ -1,6 +1,21 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + import paddle import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr diff --git a/PaddleCV/image_classification/models/inception_v4.py b/PaddleCV/image_classification/models/inception_v4.py index 8c6c0dbb129f903b4f0b849f930a520b5f17e5db..47d406be7a426568c042ef9375288a64fb5d86c2 100644 --- a/PaddleCV/image_classification/models/inception_v4.py +++ b/PaddleCV/image_classification/models/inception_v4.py @@ -1,9 +1,25 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + +import math + import paddle import paddle.fluid as fluid -import math from paddle.fluid.param_attr import ParamAttr __all__ = ['InceptionV4'] diff --git a/PaddleCV/image_classification/models/mobilenet.py b/PaddleCV/image_classification/models/mobilenet.py index d242bc946a7b4bec9c9d2e34da2496c0901ba870..4a1154e1a5bd03a241effb8e4ef05bc4d8636929 100644 --- a/PaddleCV/image_classification/models/mobilenet.py +++ b/PaddleCV/image_classification/models/mobilenet.py @@ -1,6 +1,21 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + import paddle.fluid as fluid from paddle.fluid.initializer import MSRA from paddle.fluid.param_attr import ParamAttr diff --git a/PaddleCV/image_classification/models/resnet.py b/PaddleCV/image_classification/models/resnet.py index b44a6192e798e7513fed0af2ee17023b4ef2aec6..3f705d40e9f71bbc9e2ee0164ab27c38bbb17530 100644 --- a/PaddleCV/image_classification/models/resnet.py +++ b/PaddleCV/image_classification/models/resnet.py @@ -1,9 +1,25 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + +import math + import paddle import paddle.fluid as fluid -import math from paddle.fluid.param_attr import ParamAttr __all__ = ["ResNet", "ResNet18", "ResNet34", "ResNet50", "ResNet101", "ResNet152"] diff --git a/PaddleCV/image_classification/models/resnet_dist.py b/PaddleCV/image_classification/models/resnet_dist.py index 4656b4a260758d8b24eecee99a3a672d5de671d0..fad32e8b3e4a6cdb8e685de9ee8d2a0ebb86599c 100644 --- a/PaddleCV/image_classification/models/resnet_dist.py +++ b/PaddleCV/image_classification/models/resnet_dist.py @@ -1,10 +1,27 @@ -#NOTE: This is for distributed resnet +#copyright (c) 2019 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. + +#NOTE: This is for distributed resnet. + from __future__ import absolute_import from __future__ import division from __future__ import print_function + +import math + import paddle import paddle.fluid as fluid -import math __all__ = ["DistResNet"] diff --git a/PaddleCV/image_classification/models/resnet_vc.py b/PaddleCV/image_classification/models/resnet_vc.py index d715193e18ba134708c0a6a6ea2fa1a0f055bf0f..71b3f533de2a3b6e29a76d96565e9f665a3ccb45 100644 --- a/PaddleCV/image_classification/models/resnet_vc.py +++ b/PaddleCV/image_classification/models/resnet_vc.py @@ -1,10 +1,25 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function +import math + import paddle import paddle.fluid as fluid -import math from paddle.fluid.param_attr import ParamAttr __all__ = ["ResNet", "ResNet50_vc", "ResNet101_vc", "ResNet152_vc"] diff --git a/PaddleCV/image_classification/models/resnet_vd.py b/PaddleCV/image_classification/models/resnet_vd.py index edbe0f9ea056390f08042fafe0b8127bff21afc3..e56a9766c228c87d9b0cede3adc9e319cabf8255 100644 --- a/PaddleCV/image_classification/models/resnet_vd.py +++ b/PaddleCV/image_classification/models/resnet_vd.py @@ -1,10 +1,26 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + +import math + import paddle import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr -import math __all__ = ["ResNet", "ResNet50_vd","ResNet101_vd", "ResNet152_vd", "ResNet200_vd"] diff --git a/PaddleCV/image_classification/models/resnext.py b/PaddleCV/image_classification/models/resnext.py index f0b5e110d2c753781e6702f177e368df30512670..a50db517af4a3e807fbd41d6729dbbb759bc2dc2 100644 --- a/PaddleCV/image_classification/models/resnext.py +++ b/PaddleCV/image_classification/models/resnext.py @@ -1,9 +1,25 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + +import math + import paddle import paddle.fluid as fluid -import math from paddle.fluid.param_attr import ParamAttr __all__ = ["ResNeXt", "ResNeXt50_64x4d", "ResNeXt101_64x4d", "ResNeXt152_64x4d"] diff --git a/PaddleCV/image_classification/models/se_resnext.py b/PaddleCV/image_classification/models/se_resnext.py index 0ae3d66fddbe2d1b9da5e2f52fe80d15931d256d..697c551e147bed481c0aa88682b0866716d59f93 100644 --- a/PaddleCV/image_classification/models/se_resnext.py +++ b/PaddleCV/image_classification/models/se_resnext.py @@ -1,9 +1,25 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + +import math + import paddle import paddle.fluid as fluid -import math from paddle.fluid.param_attr import ParamAttr __all__ = [ diff --git a/PaddleCV/image_classification/models/se_resnext_vd.py b/PaddleCV/image_classification/models/se_resnext_vd.py index 10d953f5d2a57b83a193bc021d44a79cfe415f15..d4c919ff5539edf8c5d54d8f7dd5074090a819f0 100644 --- a/PaddleCV/image_classification/models/se_resnext_vd.py +++ b/PaddleCV/image_classification/models/se_resnext_vd.py @@ -1,10 +1,25 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function +import math + import paddle import paddle.fluid as fluid -import math from paddle.fluid.param_attr import ParamAttr __all__ = [ diff --git a/PaddleCV/image_classification/models/shufflenet_v2.py b/PaddleCV/image_classification/models/shufflenet_v2.py index c1467e4546372b4d03050ae0f38afe1e11ae615b..0c48d7eab5588f4568899e1371851e4c41744225 100644 --- a/PaddleCV/image_classification/models/shufflenet_v2.py +++ b/PaddleCV/image_classification/models/shufflenet_v2.py @@ -1,3 +1,23 @@ +#copyright (c) 2019 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 __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import math + import paddle.fluid as fluid from paddle.fluid.initializer import MSRA from paddle.fluid.param_attr import ParamAttr diff --git a/PaddleCV/image_classification/models/vgg.py b/PaddleCV/image_classification/models/vgg.py index 8fcd2d9f1c397a428685cfb7bd264f18c0d0a7e7..a69bb39fbb6914336ec0b7f31cf17740724262d0 100644 --- a/PaddleCV/image_classification/models/vgg.py +++ b/PaddleCV/image_classification/models/vgg.py @@ -1,6 +1,21 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + import paddle import paddle.fluid as fluid diff --git a/PaddleCV/image_classification/reader.py b/PaddleCV/image_classification/reader.py index 373a3023c90c7074f483833a307ea405002dc886..cb0acee9b5abbcc6e6f5be0313087609745d1828 100644 --- a/PaddleCV/image_classification/reader.py +++ b/PaddleCV/image_classification/reader.py @@ -1,11 +1,26 @@ +#copyright (c) 2019 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 import math import random import functools import numpy as np -import paddle from PIL import Image, ImageEnhance +import paddle + random.seed(0) np.random.seed(0) diff --git a/PaddleCV/image_classification/reader_cv2.py b/PaddleCV/image_classification/reader_cv2.py index 7b9a714c599b7cb3ec9339bf19a0a5a43b745789..d720754af64a00737fe38a0c4dc2f0fb740d3b9c 100644 --- a/PaddleCV/image_classification/reader_cv2.py +++ b/PaddleCV/image_classification/reader_cv2.py @@ -1,12 +1,27 @@ +#copyright (c) 2019 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 import math import random import functools import numpy as np -import paddle import cv2 import io +import paddle + random.seed(0) np.random.seed(0) diff --git a/PaddleCV/image_classification/train.py b/PaddleCV/image_classification/train.py index 467ef098dbc3dd966111d896a5fd1c21928a1c11..cb33fd72c0fa4194132bfaed5cedc159e3963850 100644 --- a/PaddleCV/image_classification/train.py +++ b/PaddleCV/image_classification/train.py @@ -1,19 +1,35 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + import os import numpy as np import time import sys import functools import math +import argparse +import functools +import subprocess + import paddle import paddle.fluid as fluid import paddle.dataset.flowers as flowers import reader_cv2 as reader -import argparse -import functools -import subprocess import utils import models from utils.fp16_utils import create_master_params_grads, master_param_to_train_param diff --git a/PaddleCV/image_classification/utils/fp16_utils.py b/PaddleCV/image_classification/utils/fp16_utils.py index bc55f77d7856c9efde805aa82cb59d1193818623..fbae4dc340a4627fc1618d9a0fb3e8e4d457e1e1 100644 --- a/PaddleCV/image_classification/utils/fp16_utils.py +++ b/PaddleCV/image_classification/utils/fp16_utils.py @@ -1,4 +1,19 @@ +#copyright (c) 2019 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 __future__ import print_function + import paddle import paddle.fluid as fluid import paddle.fluid.core as core diff --git a/PaddleCV/image_classification/utils/learning_rate.py b/PaddleCV/image_classification/utils/learning_rate.py index f505d79e670b1625472061a3a6de38b0a5fd4e93..2a2c10d10ca2b4332fc7429edd07e4ff4140a2d9 100644 --- a/PaddleCV/image_classification/utils/learning_rate.py +++ b/PaddleCV/image_classification/utils/learning_rate.py @@ -1,13 +1,28 @@ +#copyright (c) 2019 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 __future__ import absolute_import from __future__ import division from __future__ import print_function + +import math + import paddle import paddle.fluid as fluid import paddle.fluid.layers.ops as ops from paddle.fluid.initializer import init_on_cpu from paddle.fluid.layers.learning_rate_scheduler import _decay_step_counter -import math - def cosine_decay(learning_rate, step_each_epoch, epochs=120): """Applies cosine decay to the learning rate. diff --git a/PaddleCV/image_classification/utils/utility.py b/PaddleCV/image_classification/utils/utility.py index c28646da24cb0fb42a91a2cbff92c20db307da81..33ac1e35752ea30205c5f91c54373b179706ed46 100644 --- a/PaddleCV/image_classification/utils/utility.py +++ b/PaddleCV/image_classification/utils/utility.py @@ -16,11 +16,10 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function + import distutils.util import numpy as np import six -from paddle.fluid import core - def print_arguments(args): """Print argparse's arguments.