Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
55138a40
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
55138a40
编写于
6月 19, 2019
作者:
R
ruri
提交者:
GitHub
6月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add license and follow PEP 8 (#2452)
上级
e2075983
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
468 addition
and
33 deletion
+468
-33
PaddleCV/image_classification/dist_train/batch_merge.py
PaddleCV/image_classification/dist_train/batch_merge.py
+14
-0
PaddleCV/image_classification/dist_train/dist_utils.py
PaddleCV/image_classification/dist_train/dist_utils.py
+14
-0
PaddleCV/image_classification/dist_train/env.py
PaddleCV/image_classification/dist_train/env.py
+14
-0
PaddleCV/image_classification/eval.py
PaddleCV/image_classification/eval.py
+21
-5
PaddleCV/image_classification/fast_imagenet/datasets.py
PaddleCV/image_classification/fast_imagenet/datasets.py
+14
-0
PaddleCV/image_classification/fast_imagenet/reader.py
PaddleCV/image_classification/fast_imagenet/reader.py
+17
-2
PaddleCV/image_classification/fast_imagenet/tools/resize.py
PaddleCV/image_classification/fast_imagenet/tools/resize.py
+17
-1
PaddleCV/image_classification/fast_imagenet/train.py
PaddleCV/image_classification/fast_imagenet/train.py
+1
-1
PaddleCV/image_classification/fast_imagenet/transforms.py
PaddleCV/image_classification/fast_imagenet/transforms.py
+17
-0
PaddleCV/image_classification/infer.py
PaddleCV/image_classification/infer.py
+20
-4
PaddleCV/image_classification/models/alexnet.py
PaddleCV/image_classification/models/alexnet.py
+17
-1
PaddleCV/image_classification/models/dpn.py
PaddleCV/image_classification/models/dpn.py
+17
-1
PaddleCV/image_classification/models/googlenet.py
PaddleCV/image_classification/models/googlenet.py
+15
-0
PaddleCV/image_classification/models/inception_v4.py
PaddleCV/image_classification/models/inception_v4.py
+17
-1
PaddleCV/image_classification/models/mobilenet.py
PaddleCV/image_classification/models/mobilenet.py
+15
-0
PaddleCV/image_classification/models/resnet.py
PaddleCV/image_classification/models/resnet.py
+17
-1
PaddleCV/image_classification/models/resnet_dist.py
PaddleCV/image_classification/models/resnet_dist.py
+19
-2
PaddleCV/image_classification/models/resnet_vc.py
PaddleCV/image_classification/models/resnet_vc.py
+16
-1
PaddleCV/image_classification/models/resnet_vd.py
PaddleCV/image_classification/models/resnet_vd.py
+17
-1
PaddleCV/image_classification/models/resnext.py
PaddleCV/image_classification/models/resnext.py
+17
-1
PaddleCV/image_classification/models/se_resnext.py
PaddleCV/image_classification/models/se_resnext.py
+17
-1
PaddleCV/image_classification/models/se_resnext_vd.py
PaddleCV/image_classification/models/se_resnext_vd.py
+16
-1
PaddleCV/image_classification/models/shufflenet_v2.py
PaddleCV/image_classification/models/shufflenet_v2.py
+20
-0
PaddleCV/image_classification/models/vgg.py
PaddleCV/image_classification/models/vgg.py
+15
-0
PaddleCV/image_classification/reader.py
PaddleCV/image_classification/reader.py
+16
-1
PaddleCV/image_classification/reader_cv2.py
PaddleCV/image_classification/reader_cv2.py
+16
-1
PaddleCV/image_classification/train.py
PaddleCV/image_classification/train.py
+19
-3
PaddleCV/image_classification/utils/fp16_utils.py
PaddleCV/image_classification/utils/fp16_utils.py
+15
-0
PaddleCV/image_classification/utils/learning_rate.py
PaddleCV/image_classification/utils/learning_rate.py
+17
-2
PaddleCV/image_classification/utils/utility.py
PaddleCV/image_classification/utils/utility.py
+1
-2
未找到文件。
PaddleCV/image_classification/dist_train/batch_merge.py
浏览文件 @
55138a40
#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
paddle.fluid
as
fluid
import
numpy
as
np
import
numpy
as
np
...
...
PaddleCV/image_classification/dist_train/dist_utils.py
浏览文件 @
55138a40
#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
os
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
...
...
PaddleCV/image_classification/dist_train/env.py
浏览文件 @
55138a40
#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
os
...
...
PaddleCV/image_classification/eval.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
numpy
as
np
import
time
import
time
import
sys
import
sys
import
paddle
import
math
import
paddle.fluid
as
fluid
import
numpy
as
np
import
reader_cv2
as
reader
import
argparse
import
argparse
import
functools
import
functools
import
paddle
import
paddle.fluid
as
fluid
import
reader_cv2
as
reader
import
models
import
models
from
utils.learning_rate
import
cosine_decay
from
utils.learning_rate
import
cosine_decay
from
utils.utility
import
add_arguments
,
print_arguments
from
utils.utility
import
add_arguments
,
print_arguments
import
math
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
add_arg
=
functools
.
partial
(
add_arguments
,
argparser
=
parser
)
add_arg
=
functools
.
partial
(
add_arguments
,
argparser
=
parser
)
...
...
PaddleCV/image_classification/fast_imagenet/datasets.py
浏览文件 @
55138a40
#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
PIL
import
Image
import
os
import
os
...
...
PaddleCV/image_classification/fast_imagenet/reader.py
浏览文件 @
55138a40
#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
division
import
os
from
__future__
import
print_function
import
os
import
numpy
as
np
import
numpy
as
np
import
math
import
math
import
random
import
random
import
pickle
import
pickle
from
tqdm
import
tqdm
from
tqdm
import
tqdm
import
time
import
time
...
...
PaddleCV/image_classification/fast_imagenet/tools/resize.py
浏览文件 @
55138a40
#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
PIL
import
Image
from
pathlib
import
Path
from
pathlib
import
Path
from
concurrent.futures
import
ThreadPoolExecutor
,
ProcessPoolExecutor
from
concurrent.futures
import
ThreadPoolExecutor
,
ProcessPoolExecutor
from
functools
import
partial
from
functools
import
partial
import
multiprocessing
import
multiprocessing
cpus
=
multiprocessing
.
cpu_count
()
cpus
=
multiprocessing
.
cpu_count
()
cpus
=
min
(
36
,
cpus
)
cpus
=
min
(
36
,
cpus
)
...
@@ -41,4 +57,4 @@ for sz in szs:
...
@@ -41,4 +57,4 @@ for sz in szs:
for
ds
in
(
"validation"
,
"train"
):
for
ds
in
(
"validation"
,
"train"
):
print
(
PATH
/
ds
)
print
(
PATH
/
ds
)
resize_imgs
(
PATH
/
ds
)
resize_imgs
(
PATH
/
ds
)
\ No newline at end of file
PaddleCV/image_classification/fast_imagenet/train.py
浏览文件 @
55138a40
# Copyright (c) 201
8
PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 201
9
PaddlePaddle Authors. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
...
PaddleCV/image_classification/fast_imagenet/transforms.py
浏览文件 @
55138a40
#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
division
from
__future__
import
print_function
import
math
import
math
import
random
import
random
from
PIL
import
Image
from
PIL
import
Image
...
...
PaddleCV/image_classification/infer.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
numpy
as
np
import
time
import
time
import
sys
import
sys
import
math
import
numpy
as
np
import
argparse
import
functools
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
reader_cv2
as
reader
import
reader_cv2
as
reader
import
argparse
import
functools
import
models
import
models
import
utils
import
utils
from
utils.utility
import
add_arguments
,
print_arguments
from
utils.utility
import
add_arguments
,
print_arguments
import
math
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
parser
=
argparse
.
ArgumentParser
(
description
=
__doc__
)
# yapf: disable
# yapf: disable
...
...
PaddleCV/image_classification/models/alexnet.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
math
__all__
=
[
'AlexNet'
]
__all__
=
[
'AlexNet'
]
...
...
PaddleCV/image_classification/models/dpn.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
numpy
as
np
import
numpy
as
np
import
time
import
time
import
sys
import
sys
import
paddle.fluid
as
fluid
import
math
import
math
import
paddle.fluid
as
fluid
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
__all__
=
[
"DPN"
,
"DPN68"
,
"DPN92"
,
"DPN98"
,
"DPN107"
,
"DPN131"
]
__all__
=
[
"DPN"
,
"DPN68"
,
"DPN92"
,
"DPN98"
,
"DPN107"
,
"DPN131"
]
...
...
PaddleCV/image_classification/models/googlenet.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
...
...
PaddleCV/image_classification/models/inception_v4.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
math
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
__all__
=
[
'InceptionV4'
]
__all__
=
[
'InceptionV4'
]
...
...
PaddleCV/image_classification/models/mobilenet.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
from
paddle.fluid.initializer
import
MSRA
from
paddle.fluid.initializer
import
MSRA
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
...
...
PaddleCV/image_classification/models/resnet.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
math
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
__all__
=
[
"ResNet"
,
"ResNet18"
,
"ResNet34"
,
"ResNet50"
,
"ResNet101"
,
"ResNet152"
]
__all__
=
[
"ResNet"
,
"ResNet18"
,
"ResNet34"
,
"ResNet50"
,
"ResNet101"
,
"ResNet152"
]
...
...
PaddleCV/image_classification/models/resnet_dist.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
math
__all__
=
[
"DistResNet"
]
__all__
=
[
"DistResNet"
]
...
...
PaddleCV/image_classification/models/resnet_vc.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
math
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
__all__
=
[
"ResNet"
,
"ResNet50_vc"
,
"ResNet101_vc"
,
"ResNet152_vc"
]
__all__
=
[
"ResNet"
,
"ResNet50_vc"
,
"ResNet101_vc"
,
"ResNet152_vc"
]
...
...
PaddleCV/image_classification/models/resnet_vd.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
import
math
__all__
=
[
"ResNet"
,
"ResNet50_vd"
,
"ResNet101_vd"
,
"ResNet152_vd"
,
"ResNet200_vd"
]
__all__
=
[
"ResNet"
,
"ResNet50_vd"
,
"ResNet101_vd"
,
"ResNet152_vd"
,
"ResNet200_vd"
]
...
...
PaddleCV/image_classification/models/resnext.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
math
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
__all__
=
[
"ResNeXt"
,
"ResNeXt50_64x4d"
,
"ResNeXt101_64x4d"
,
"ResNeXt152_64x4d"
]
__all__
=
[
"ResNeXt"
,
"ResNeXt50_64x4d"
,
"ResNeXt101_64x4d"
,
"ResNeXt152_64x4d"
]
...
...
PaddleCV/image_classification/models/se_resnext.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
math
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
__all__
=
[
__all__
=
[
...
...
PaddleCV/image_classification/models/se_resnext_vd.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
math
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
__all__
=
[
__all__
=
[
...
...
PaddleCV/image_classification/models/shufflenet_v2.py
浏览文件 @
55138a40
#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
import
paddle.fluid
as
fluid
from
paddle.fluid.initializer
import
MSRA
from
paddle.fluid.initializer
import
MSRA
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
...
...
PaddleCV/image_classification/models/vgg.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
...
...
PaddleCV/image_classification/reader.py
浏览文件 @
55138a40
#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
os
import
math
import
math
import
random
import
random
import
functools
import
functools
import
numpy
as
np
import
numpy
as
np
import
paddle
from
PIL
import
Image
,
ImageEnhance
from
PIL
import
Image
,
ImageEnhance
import
paddle
random
.
seed
(
0
)
random
.
seed
(
0
)
np
.
random
.
seed
(
0
)
np
.
random
.
seed
(
0
)
...
...
PaddleCV/image_classification/reader_cv2.py
浏览文件 @
55138a40
#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
os
import
math
import
math
import
random
import
random
import
functools
import
functools
import
numpy
as
np
import
numpy
as
np
import
paddle
import
cv2
import
cv2
import
io
import
io
import
paddle
random
.
seed
(
0
)
random
.
seed
(
0
)
np
.
random
.
seed
(
0
)
np
.
random
.
seed
(
0
)
...
...
PaddleCV/image_classification/train.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
numpy
as
np
import
numpy
as
np
import
time
import
time
import
sys
import
sys
import
functools
import
functools
import
math
import
math
import
argparse
import
functools
import
subprocess
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.dataset.flowers
as
flowers
import
paddle.dataset.flowers
as
flowers
import
reader_cv2
as
reader
import
reader_cv2
as
reader
import
argparse
import
functools
import
subprocess
import
utils
import
utils
import
models
import
models
from
utils.fp16_utils
import
create_master_params_grads
,
master_param_to_train_param
from
utils.fp16_utils
import
create_master_params_grads
,
master_param_to_train_param
...
...
PaddleCV/image_classification/utils/fp16_utils.py
浏览文件 @
55138a40
#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
from
__future__
import
print_function
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.fluid.core
as
core
import
paddle.fluid.core
as
core
...
...
PaddleCV/image_classification/utils/learning_rate.py
浏览文件 @
55138a40
#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
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
math
import
paddle
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
import
paddle.fluid.layers.ops
as
ops
import
paddle.fluid.layers.ops
as
ops
from
paddle.fluid.initializer
import
init_on_cpu
from
paddle.fluid.initializer
import
init_on_cpu
from
paddle.fluid.layers.learning_rate_scheduler
import
_decay_step_counter
from
paddle.fluid.layers.learning_rate_scheduler
import
_decay_step_counter
import
math
def
cosine_decay
(
learning_rate
,
step_each_epoch
,
epochs
=
120
):
def
cosine_decay
(
learning_rate
,
step_each_epoch
,
epochs
=
120
):
"""Applies cosine decay to the learning rate.
"""Applies cosine decay to the learning rate.
...
...
PaddleCV/image_classification/utils/utility.py
浏览文件 @
55138a40
...
@@ -16,11 +16,10 @@
...
@@ -16,11 +16,10 @@
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
distutils.util
import
distutils.util
import
numpy
as
np
import
numpy
as
np
import
six
import
six
from
paddle.fluid
import
core
def
print_arguments
(
args
):
def
print_arguments
(
args
):
"""Print argparse's arguments.
"""Print argparse's arguments.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录