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:
TRAIN
:
batch_size
:
256
num_workers
:
4
file_list: "./dataset/NUS-SCENE-dataset/multilabel_train_list.txt"
data_dir: "./dataset/NUS-SCENE-dataset/images"
file_list
:
"
./dataset/NUS-
WIDE-SCENE/NUS-
SCENE-dataset/multilabel_train_list.txt"
data_dir
:
"
./dataset/NUS-
WIDE-SCENE/NUS-
SCENE-dataset/images"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
...
...
@@ -59,8 +59,8 @@ TRAIN:
VALID
:
batch_size
:
64
num_workers
:
4
file_list: "./dataset/NUS-SCENE-dataset/multilabel_test_list.txt"
data_dir: "./dataset/NUS-SCENE-dataset/images"
file_list
:
"
./dataset/NUS-
WIDE-SCENE/NUS-
SCENE-dataset/multilabel_test_list.txt"
data_dir
:
"
./dataset/NUS-
WIDE-SCENE/NUS-
SCENE-dataset/images"
shuffle_seed
:
0
transforms
:
-
DecodeImage
:
...
...
ppcls/modeling/loss.py
浏览文件 @
fee32b55
...
...
@@ -89,8 +89,8 @@ class MultiLabelLoss(Loss):
def
__init__
(
self
,
class_dim
=
1000
,
epsilon
=
None
):
super
(
MultiLabelLoss
,
self
).
__init__
(
class_dim
,
epsilon
)
def
__call__
(
self
,
input
,
target
,
use_pure_fp16
=
False
):
cost
=
self
.
_binary_crossentropy
(
input
,
target
,
use_pure_fp16
)
def
__call__
(
self
,
input
,
target
):
cost
=
self
.
_binary_crossentropy
(
input
,
target
)
return
cost
...
...
tools/infer/infer.py
浏览文件 @
fee32b55
...
...
@@ -72,10 +72,15 @@ def main():
for
number
,
result_dict
in
enumerate
(
batch_result_list
):
filename
=
img_path_list
[
number
].
split
(
"/"
)[
-
1
]
clas_ids
=
result_dict
[
"clas_ids"
]
scores_str
=
"[{}]"
.
format
(
", "
.
join
(
"{:.2f}"
.
format
(
r
)
for
r
in
result_dict
[
"scores"
]))
print
(
"File:{}, Top-{} result: class id(s): {}, score(s): {}"
.
format
(
filename
,
args
.
top_k
,
clas_ids
,
scores_str
))
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
(
r
)
for
r
in
result_dict
[
"scores"
]))
print
(
"File:{}, Top-{} result: class id(s): {}, score(s): {}"
.
format
(
filename
,
args
.
top_k
,
clas_ids
,
scores_str
))
if
args
.
pre_label_image
:
save_prelabel_results
(
clas_ids
[
0
],
img_path_list
[
number
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录