Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
25d6c326
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
25d6c326
编写于
2月 22, 2023
作者:
W
wangguanzhong
提交者:
GitHub
2月 22, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix unittest (#7807)
上级
e5e20169
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
17 deletion
+27
-17
configs/datasets/voc.yml
configs/datasets/voc.yml
+12
-12
configs/runtime.yml
configs/runtime.yml
+1
-0
ppdet/core/workspace.py
ppdet/core/workspace.py
+10
-1
ppdet/engine/trainer.py
ppdet/engine/trainer.py
+4
-4
未找到文件。
configs/datasets/voc.yml
浏览文件 @
25d6c326
...
...
@@ -3,19 +3,19 @@ map_type: 11point
num_classes
:
20
TrainDataset
:
!
VOCDataSet
dataset_dir
:
dataset/voc
anno_path
:
trainval.txt
label_list
:
label_list.txt
data_fields
:
[
'
image'
,
'
gt_bbox'
,
'
gt_class'
,
'
difficult'
]
name
:
VOCDataSet
dataset_dir
:
dataset/voc
anno_path
:
trainval.txt
label_list
:
label_list.txt
data_fields
:
[
'
image'
,
'
gt_bbox'
,
'
gt_class'
,
'
difficult'
]
EvalDataset
:
!
VOCDataSet
dataset_dir
:
dataset/voc
anno_path
:
test.txt
label_list
:
label_list.txt
data_fields
:
[
'
image'
,
'
gt_bbox'
,
'
gt_class'
,
'
difficult'
]
name
:
VOCDataSet
dataset_dir
:
dataset/voc
anno_path
:
test.txt
label_list
:
label_list.txt
data_fields
:
[
'
image'
,
'
gt_bbox'
,
'
gt_class'
,
'
difficult'
]
TestDataset
:
!
ImageFolder
anno_path
:
dataset/voc/label_list.txt
name
:
ImageFolder
anno_path
:
dataset/voc/label_list.txt
configs/runtime.yml
浏览文件 @
25d6c326
use_gpu
:
true
use_xpu
:
false
use_mlu
:
false
use_npu
:
false
log_iter
:
20
save_dir
:
output
snapshot_epoch
:
1
...
...
ppdet/core/workspace.py
浏览文件 @
25d6c326
...
...
@@ -67,6 +67,15 @@ class AttrDict(dict):
return
self
[
key
]
raise
AttributeError
(
"object has no attribute '{}'"
.
format
(
key
))
def
__setattr__
(
self
,
key
,
value
):
self
[
key
]
=
value
def
copy
(
self
):
new_dict
=
AttrDict
()
for
k
,
v
in
self
.
items
():
new_dict
.
update
({
k
:
v
})
return
new_dict
global_config
=
AttrDict
()
...
...
@@ -280,4 +289,4 @@ def create(cls_or_name, **kwargs):
# prevent modification of global config values of reference types
# (e.g., list, dict) from within the created module instances
#kwargs = copy.deepcopy(kwargs)
return
cls
(
**
cls_kwargs
)
\ No newline at end of file
return
cls
(
**
cls_kwargs
)
ppdet/engine/trainer.py
浏览文件 @
25d6c326
...
...
@@ -62,7 +62,7 @@ MOT_ARCH = ['JDE', 'FairMOT', 'DeepSORT', 'ByteTrack', 'CenterTrack']
class
Trainer
(
object
):
def
__init__
(
self
,
cfg
,
mode
=
'train'
):
self
.
cfg
=
cfg
self
.
cfg
=
cfg
.
copy
()
assert
mode
.
lower
()
in
[
'train'
,
'eval'
,
'test'
],
\
"mode should be 'train', 'eval' or 'test'"
self
.
mode
=
mode
.
lower
()
...
...
@@ -99,12 +99,12 @@ class Trainer(object):
self
.
dataset
,
cfg
.
worker_num
)
if
cfg
.
architecture
==
'JDE'
and
self
.
mode
==
'train'
:
cfg
[
'JDEEmbeddingHead'
][
self
.
cfg
[
'JDEEmbeddingHead'
][
'num_identities'
]
=
self
.
dataset
.
num_identities_dict
[
0
]
# JDE only support single class MOT now.
if
cfg
.
architecture
==
'FairMOT'
and
self
.
mode
==
'train'
:
cfg
[
'FairMOTEmbeddingHead'
][
self
.
cfg
[
'FairMOTEmbeddingHead'
][
'num_identities_dict'
]
=
self
.
dataset
.
num_identities_dict
# FairMOT support single class and multi-class MOT now.
...
...
@@ -149,7 +149,7 @@ class Trainer(object):
reader_name
=
'{}Reader'
.
format
(
self
.
mode
.
capitalize
())
# If metric is VOC, need to be set collate_batch=False.
if
cfg
.
metric
==
'VOC'
:
cfg
[
reader_name
][
'collate_batch'
]
=
False
self
.
cfg
[
reader_name
][
'collate_batch'
]
=
False
self
.
loader
=
create
(
reader_name
)(
self
.
dataset
,
cfg
.
worker_num
,
self
.
_eval_batch_sampler
)
# TestDataset build after user set images, skip loader creation here
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录