Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
4fdcda7c
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4fdcda7c
编写于
1月 10, 2023
作者:
H
HydrogenSulfate
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug in randaug, train_progressive and efficientnet_v2
上级
7e12c73e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
3 deletion
+19
-3
ppcls/arch/backbone/model_zoo/efficientnet_v2.py
ppcls/arch/backbone/model_zoo/efficientnet_v2.py
+2
-1
ppcls/data/preprocess/__init__.py
ppcls/data/preprocess/__init__.py
+12
-0
ppcls/data/preprocess/ops/randaugment.py
ppcls/data/preprocess/ops/randaugment.py
+2
-0
ppcls/engine/train/train_progressive.py
ppcls/engine/train/train_progressive.py
+3
-2
未找到文件。
ppcls/arch/backbone/model_zoo/efficientnet_v2.py
浏览文件 @
4fdcda7c
...
...
@@ -268,7 +268,8 @@ v2_xl_block = [ # only for 21k pretraining.
]
efficientnetv2_params
=
{
# params: (block, width, depth, dropout)
"efficientnetv2-s"
:
(
v2_s_block
,
1.0
,
1.0
,
np
.
linspace
(
0.1
,
0.3
,
4
)),
"efficientnetv2-s"
:
(
v2_s_block
,
1.0
,
1.0
,
np
.
linspace
(
0.1
,
0.3
,
4
).
tolist
()),
"efficientnetv2-m"
:
(
v2_m_block
,
1.0
,
1.0
,
0.3
),
"efficientnetv2-l"
:
(
v2_l_block
,
1.0
,
1.0
,
0.4
),
"efficientnetv2-xl"
:
(
v2_xl_block
,
1.0
,
1.0
,
0.4
),
...
...
ppcls/data/preprocess/__init__.py
浏览文件 @
4fdcda7c
...
...
@@ -109,6 +109,18 @@ class RandAugmentV2(RawRandAugmentV2):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
def
__call__
(
self
,
img
):
if
not
isinstance
(
img
,
Image
.
Image
):
img
=
np
.
ascontiguousarray
(
img
)
img
=
Image
.
fromarray
(
img
)
img
=
super
().
__call__
(
img
)
if
isinstance
(
img
,
Image
.
Image
):
img
=
np
.
asarray
(
img
)
return
img
class
TimmAutoAugment
(
RawTimmAutoAugment
):
""" TimmAutoAugment wrapper to auto fit different img tyeps. """
...
...
ppcls/data/preprocess/ops/randaugment.py
浏览文件 @
4fdcda7c
...
...
@@ -203,6 +203,8 @@ class RandAugmentV2(RandAugment):
"cutout"
:
int
(
40
*
abso_level
)
}
# from https://stackoverflow.com/questions/5252170/
# specify-image-filling-color-when-rotating-in-python-with-pil-and-setting-expand
def
rotate_with_fill
(
img
,
magnitude
):
rot
=
img
.
convert
(
"RGBA"
).
rotate
(
magnitude
)
return
Image
.
composite
(
rot
,
...
...
ppcls/engine/train/train_progressive.py
浏览文件 @
4fdcda7c
...
...
@@ -48,11 +48,12 @@ def train_epoch_progressive(engine, epoch_id, print_batch_step):
cur_image_size
=
engine
.
config
[
"DataLoader"
][
"Train"
][
"dataset"
][
"transform_ops"
][
1
][
"RandCropImage"
][
"progress_size"
][
stage_id
]
cur_magnitude
=
engine
.
config
[
"DataLoader"
][
"Train"
][
"dataset"
][
"transform_ops"
][
3
][
"RandAugment"
][
"progress_magnitude"
][
stage_id
]
"transform_ops"
][
3
][
"RandAugmentV2"
][
"progress_magnitude"
][
stage_id
]
engine
.
config
[
"DataLoader"
][
"Train"
][
"dataset"
][
"transform_ops"
][
1
][
"RandCropImage"
][
"size"
]
=
cur_image_size
engine
.
config
[
"DataLoader"
][
"Train"
][
"dataset"
][
"transform_ops"
][
3
][
"RandAugment"
][
"magnitude"
]
=
cur_magnitude
"RandAugment
V2
"
][
"magnitude"
]
=
cur_magnitude
engine
.
train_dataloader
=
build_dataloader
(
engine
.
config
[
"DataLoader"
],
"Train"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录