config.py 1.3 KB
Newer Older
W
wuyefeilin 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# coding: utf8
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

W
wuzewu 已提交
16 17 18 19 20 21 22
from utils.util import AttrDict, merge_cfg_from_args, get_arguments
import os

args = get_arguments()
cfg = AttrDict()

# 待预测图像所在路径
L
LutaoChu 已提交
23
cfg.data_dir = os.path.join("data", "testing_images")
W
wuzewu 已提交
24
# 待预测图像名称列表
L
LutaoChu 已提交
25
cfg.data_list_file = os.path.join("data", "test_id.txt")
W
wuzewu 已提交
26
# 模型加载路径
L
LutaoChu 已提交
27
cfg.model_path = args.example
W
wuzewu 已提交
28
# 预测结果保存路径
L
LutaoChu 已提交
29
cfg.vis_dir = "result"
W
wuzewu 已提交
30 31 32 33 34 35

# 预测类别数
cfg.class_num = 20
# 均值, 图像预处理减去的均值
cfg.MEAN = 0.406, 0.456, 0.485
# 标准差,图像预处理除以标准差
W
wuyefeilin 已提交
36
cfg.STD = 0.225, 0.224, 0.229
W
wuzewu 已提交
37 38

# 多尺度预测时图像尺寸
W
wuyefeilin 已提交
39
cfg.multi_scales = (377, 377), (473, 473), (567, 567)
W
wuzewu 已提交
40 41 42 43
# 多尺度预测时图像是否水平翻转
cfg.flip = True

merge_cfg_from_args(args, cfg)