Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • PaddleDetection
  • 合并请求
  • !38

P
PaddleDetection
  • 项目概览

PaddlePaddle / PaddleDetection
大约 2 年 前同步成功

通知 708
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看板

Polish reader. !38

  • Report abuse
!38 已关闭 11月 25, 2019 由 saxon_zh@saxon_zh 创建
#<User:0x00007fed546bc580>
  • 概览 20
  • 提交 17
  • 变更 67

Created by: qingqing01

数据预处理的operators.py、多线程/进程数据预处理复用原先的,数据解析模块coco, voc等也复用原先的,但接口做了修改,便于在config里配置。

  • 主要接口:
class Loader(object):
    def __init__(self,
               dataset=None,
               sample_transforms=None,
               batch_transforms=None,
               batch_size=None,
               fields=None,
               shuffle=False,
               drop_last=False,
               drop_empty=True,
               mixup_epoch=-1,
               class_aware_sampling=False,
               worker_num=-1,
               use_process=False,
               bufsize=100,
               memsize='3G',
               inputs_def=None,
               **kwargs):

多进程/线程 处理内容: sample_transforms-> 组batch -> batch_transforms.

  • 使用可以参考 ppdet/data2/tests

  • 会删掉data_feed.py,预先定义系列基础的数据预处理yml配置,在模型config里引用。

    用户模型的Config里配置,可以参考configs2里, 可以通过 LOADER 关键字加载一个yml的数据预处理文件

_LOADER_: 'faster_loader.yml'
TrainLoader: # 可更新faster_loader.yml里的内容
  inputs_def:
    image_shape: [3,800,800]
    fields: ['image', 'im_info', 'im_id', 'gt_bbox', 'gt_class', 'is_crowd']
  batch_size: 3
  • 删掉model_inputs.py,模型architecture里增加build_inputs接口:
    def _inputs_def(self, image_shape):
        im_shape = [None] + image_shape
        # yapf: disable
        inputs_def = {
            'image':    {'shape': im_shape,  'dtype': 'float32', 'lod_level': 0},
            'im_info':  {'shape': [None, 3], 'dtype': 'float32', 'lod_level': 0},
            'im_id':    {'shape': [None, 1], 'dtype': 'int32',   'lod_level': 0},
            'gt_bbox':   {'shape': [None, 4], 'dtype': 'float32', 'lod_level': 1},
            'gt_class': {'shape': [None, 1], 'dtype': 'int32',   'lod_level': 1},
            'is_crowd': {'shape': [None, 1], 'dtype': 'int32',   'lod_level': 1},
        }
        # yapf: enable
        return inputs_def

    def build_inputs(
            self,
            image_shape=[3, None, None],
            fields=[
                'image', 'im_info', 'im_id', 'gt_bbox', 'gt_class', 'is_crowd'
            ],  # for train
            use_dataloader=True,
            iterable=False):
        inputs_def = self._inputs_def(image_shape)
        feed_vars = OrderedDict([(key, fluid.layers.data(
            name=key,
            shape=inputs_def[key]['shape'],
            dtype=inputs_def[key]['dtype'],
            lod_level=inputs_def[key]['lod_level'])) for key in fields])
        loader = fluid.io.DataLoader.from_generator(
            feed_list=list(feed_vars.values()),
            capacity=64,
            use_double_buffer=True,
            iterable=iterable) if use_dataloader else None
        return feed_vars, loader
  • 所有更新的config PR: https://github.com/PaddlePaddle/PaddleDetection/pull/67
指派人
分配到
审核者
Request review from
无
里程碑
无
分配里程碑
工时统计
标识: paddlepaddle/PaddleDetection!38
Source branch: github/fork/qingqing01/master_polish_reader
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7