Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
a5684e58
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a5684e58
编写于
4月 04, 2019
作者:
S
SunGaofeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add print_configs in infer and test
上级
3b779edd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
10 addition
and
9 deletion
+10
-9
PaddleCV/video/configs/nonlocal.txt
PaddleCV/video/configs/nonlocal.txt
+1
-1
PaddleCV/video/datareader/nonlocal_reader.py
PaddleCV/video/datareader/nonlocal_reader.py
+1
-1
PaddleCV/video/infer.py
PaddleCV/video/infer.py
+4
-5
PaddleCV/video/models/nonlocal_model/resnet_video.py
PaddleCV/video/models/nonlocal_model/resnet_video.py
+1
-1
PaddleCV/video/scripts/infer/infer_nonlocal.sh
PaddleCV/video/scripts/infer/infer_nonlocal.sh
+1
-1
PaddleCV/video/test.py
PaddleCV/video/test.py
+2
-0
未找到文件。
PaddleCV/video/configs/nonlocal.txt
浏览文件 @
a5684e58
...
...
@@ -82,7 +82,7 @@ use_multi_crop = 1
[INFER]
num_reader_threads = 8
batch_size = 1
filelist = 'dataset/nonlocal/infer
ence
list.txt'
filelist = 'dataset/nonlocal/inferlist.txt'
crop_size = 256
sample_rate = 8
video_length = 8
...
...
PaddleCV/video/datareader/nonlocal_reader.py
浏览文件 @
a5684e58
...
...
@@ -79,7 +79,7 @@ class NonlocalReader(DataReader):
sample_times
=
1
return
reader_func
(
filelist
,
batch_size
,
sample_times
,
False
,
False
,
**
dataset_args
)
elif
self
.
mode
==
'test'
:
elif
self
.
mode
==
'test'
or
self
.
mode
==
'infer'
:
sample_times
=
cfg
[
'TEST'
][
'num_test_clips'
]
if
cfg
[
'TEST'
][
'use_multi_crop'
]
==
1
:
sample_times
=
int
(
sample_times
/
3
)
...
...
PaddleCV/video/infer.py
浏览文件 @
a5684e58
...
...
@@ -83,8 +83,9 @@ def infer(args):
# parse config
config
=
parse_config
(
args
.
config
)
infer_config
=
merge_configs
(
config
,
'infer'
,
vars
(
args
))
logger
.
info
(
"############### infer config ###############"
)
print_configs
(
infer_config
)
infer_model
=
models
.
get_model
(
args
.
model_name
,
infer_config
,
mode
=
'infer'
)
infer_model
.
build_input
(
use_pyreader
=
False
)
infer_model
.
build_model
()
infer_feeds
=
infer_model
.
feeds
()
...
...
@@ -105,10 +106,8 @@ def infer(args):
# if no weight files specified, download weights from paddle
weights
=
args
.
weights
or
infer_model
.
get_weights
()
def
if_exist
(
var
):
return
os
.
path
.
exists
(
os
.
path
.
join
(
weights
,
var
.
name
))
fluid
.
io
.
load_vars
(
exe
,
weights
,
predicate
=
if_exist
)
infer_model
.
load_test_weights
(
exe
,
weights
,
fluid
.
default_main_program
(),
place
)
infer_feeder
=
fluid
.
DataFeeder
(
place
=
place
,
feed_list
=
infer_feeds
)
fetch_list
=
[
x
.
name
for
x
in
infer_outputs
]
...
...
PaddleCV/video/models/nonlocal_model/resnet_video.py
浏览文件 @
a5684e58
...
...
@@ -123,7 +123,7 @@ def obtain_arc(arc_type, video_length):
def
create_model
(
data
,
label
,
cfg
,
is_training
=
True
,
mode
=
'train'
):
group
=
cfg
.
RESNETS
.
num_groups
width_per_group
=
cfg
.
RESNETS
.
width_per_group
batch_size
=
int
(
cfg
.
TRAIN
.
batch_size
/
cfg
.
NUM_GPUS
)
batch_size
=
int
(
cfg
.
TRAIN
.
batch_size
/
cfg
.
TRAIN
.
num_gpus
)
logger
.
info
(
'--------------- ResNet-{} {}x{}d-{}, {} ---------------'
.
format
(
cfg
.
MODEL
.
depth
,
group
,
width_per_group
,
...
...
PaddleCV/video/scripts/infer/infer_nonlocal.sh
浏览文件 @
a5684e58
python infer.py
--model_name
=
"NONLOCAL"
--config
=
./configs/nonlocal.txt
--filelist
=
./dataset/nonlocal/infer
.lis
t
\
python infer.py
--model_name
=
"NONLOCAL"
--config
=
./configs/nonlocal.txt
--filelist
=
./dataset/nonlocal/infer
list.tx
t
\
--log_interval
=
10
--weights
=
./checkpoints/NONLOCAL_epoch0
--save_dir
=
./save
PaddleCV/video/test.py
浏览文件 @
a5684e58
...
...
@@ -68,6 +68,8 @@ def test(args):
# parse config
config
=
parse_config
(
args
.
config
)
test_config
=
merge_configs
(
config
,
'test'
,
vars
(
args
))
logger
.
info
(
"############### test config ###############"
)
print_configs
(
test_config
)
# build model
test_model
=
models
.
get_model
(
args
.
model_name
,
test_config
,
mode
=
'test'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录