Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
fee32b55
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看板
提交
fee32b55
编写于
3月 30, 2021
作者:
Y
yaohai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix small error
上级
5fd7085d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
15 addition
and
10 deletion
+15
-10
configs/quick_start/ResNet50_vd_multilabel.yaml
configs/quick_start/ResNet50_vd_multilabel.yaml
+4
-4
ppcls/modeling/loss.py
ppcls/modeling/loss.py
+2
-2
tools/infer/infer.py
tools/infer/infer.py
+9
-4
未找到文件。
configs/quick_start/ResNet50_vd_multilabel.yam
→
configs/quick_start/ResNet50_vd_multilabel.yam
l
浏览文件 @
fee32b55
...
@@ -34,8 +34,8 @@ OPTIMIZER:
...
@@ -34,8 +34,8 @@ OPTIMIZER:
TRAIN
:
TRAIN
:
batch_size
:
256
batch_size
:
256
num_workers
:
4
num_workers
:
4
file_list: "./dataset/NUS-SCENE-dataset/multilabel_train_list.txt"
file_list
:
"
./dataset/NUS-
WIDE-SCENE/NUS-
SCENE-dataset/multilabel_train_list.txt"
data_dir: "./dataset/NUS-SCENE-dataset/images"
data_dir
:
"
./dataset/NUS-
WIDE-SCENE/NUS-
SCENE-dataset/images"
shuffle_seed
:
0
shuffle_seed
:
0
transforms
:
transforms
:
-
DecodeImage
:
-
DecodeImage
:
...
@@ -59,8 +59,8 @@ TRAIN:
...
@@ -59,8 +59,8 @@ TRAIN:
VALID
:
VALID
:
batch_size
:
64
batch_size
:
64
num_workers
:
4
num_workers
:
4
file_list: "./dataset/NUS-SCENE-dataset/multilabel_test_list.txt"
file_list
:
"
./dataset/NUS-
WIDE-SCENE/NUS-
SCENE-dataset/multilabel_test_list.txt"
data_dir: "./dataset/NUS-SCENE-dataset/images"
data_dir
:
"
./dataset/NUS-
WIDE-SCENE/NUS-
SCENE-dataset/images"
shuffle_seed
:
0
shuffle_seed
:
0
transforms
:
transforms
:
-
DecodeImage
:
-
DecodeImage
:
...
...
ppcls/modeling/loss.py
浏览文件 @
fee32b55
...
@@ -89,8 +89,8 @@ class MultiLabelLoss(Loss):
...
@@ -89,8 +89,8 @@ class MultiLabelLoss(Loss):
def
__init__
(
self
,
class_dim
=
1000
,
epsilon
=
None
):
def
__init__
(
self
,
class_dim
=
1000
,
epsilon
=
None
):
super
(
MultiLabelLoss
,
self
).
__init__
(
class_dim
,
epsilon
)
super
(
MultiLabelLoss
,
self
).
__init__
(
class_dim
,
epsilon
)
def
__call__
(
self
,
input
,
target
,
use_pure_fp16
=
False
):
def
__call__
(
self
,
input
,
target
):
cost
=
self
.
_binary_crossentropy
(
input
,
target
,
use_pure_fp16
)
cost
=
self
.
_binary_crossentropy
(
input
,
target
)
return
cost
return
cost
...
...
tools/infer/infer.py
浏览文件 @
fee32b55
...
@@ -72,6 +72,11 @@ def main():
...
@@ -72,6 +72,11 @@ def main():
for
number
,
result_dict
in
enumerate
(
batch_result_list
):
for
number
,
result_dict
in
enumerate
(
batch_result_list
):
filename
=
img_path_list
[
number
].
split
(
"/"
)[
-
1
]
filename
=
img_path_list
[
number
].
split
(
"/"
)[
-
1
]
clas_ids
=
result_dict
[
"clas_ids"
]
clas_ids
=
result_dict
[
"clas_ids"
]
if
multilabel
:
print
(
"File:{}, multilabel result: "
.
format
(
filename
))
for
id
,
score
in
zip
(
clas_ids
,
result_dict
[
"scores"
]):
print
(
"
\t
class id: {}, probability: {:.2f}"
.
format
(
id
,
score
))
else
:
scores_str
=
"[{}]"
.
format
(
", "
.
join
(
"{:.2f}"
.
format
(
scores_str
=
"[{}]"
.
format
(
", "
.
join
(
"{:.2f}"
.
format
(
r
)
for
r
in
result_dict
[
"scores"
]))
r
)
for
r
in
result_dict
[
"scores"
]))
print
(
"File:{}, Top-{} result: class id(s): {}, score(s): {}"
.
print
(
"File:{}, Top-{} result: class id(s): {}, score(s): {}"
.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录