Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
hapi
提交
5e496435
H
hapi
项目概览
PaddlePaddle
/
hapi
通知
11
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hapi
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5e496435
编写于
4月 20, 2020
作者:
Q
qingqing01
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean code
上级
2ad718f7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
10 addition
and
12 deletion
+10
-12
examples/ocr/data.py
examples/ocr/data.py
+1
-3
examples/ocr/eval.py
examples/ocr/eval.py
+3
-3
examples/ocr/predict.py
examples/ocr/predict.py
+1
-1
examples/ocr/seq2seq_attn.py
examples/ocr/seq2seq_attn.py
+1
-1
examples/ocr/train.py
examples/ocr/train.py
+3
-3
examples/ocr/utility.py
examples/ocr/utility.py
+1
-1
未找到文件。
examples/ocr/data.py
浏览文件 @
5e496435
...
...
@@ -97,7 +97,7 @@ class PadTarget(object):
return
samples
class
My
BatchSampler
(
fluid
.
io
.
BatchSampler
):
class
BatchSampler
(
fluid
.
io
.
BatchSampler
):
def
__init__
(
self
,
dataset
,
batch_size
,
...
...
@@ -178,8 +178,6 @@ class OCRDataset(paddle.io.Dataset):
h
,
w
=
int
(
h
),
int
(
w
)
labels
=
[
int
(
c
)
for
c
in
labels
.
split
(
','
)]
self
.
_sample_infos
.
append
(
SampleInfo
(
i
,
h
,
w
,
im_name
,
labels
))
#self._sample_infos = sorted(self._sample_infos,
# key=lambda x: x.w)
def
__getitem__
(
self
,
idx
):
info
=
self
.
_sample_infos
[
idx
]
...
...
examples/ocr/eval.py
浏览文件 @
5e496435
# Copyright (c) 20
18
PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 20
20
PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -76,7 +76,7 @@ def main(FLAGS):
test_dataset
=
data
.
test
()
test_collate_fn
=
BatchCompose
(
[
data
.
Resize
(),
data
.
Normalize
(),
data
.
PadTarget
()])
test_sampler
=
data
.
My
BatchSampler
(
test_sampler
=
data
.
BatchSampler
(
test_dataset
,
batch_size
=
FLAGS
.
batch_size
,
drop_last
=
False
,
...
...
@@ -125,7 +125,7 @@ def beam_search(FLAGS):
test_dataset
=
data
.
test
()
test_collate_fn
=
BatchCompose
(
[
data
.
Resize
(),
data
.
Normalize
(),
data
.
PadTarget
()])
test_sampler
=
data
.
My
BatchSampler
(
test_sampler
=
data
.
BatchSampler
(
test_dataset
,
batch_size
=
FLAGS
.
batch_size
,
drop_last
=
False
,
...
...
examples/ocr/predict.py
浏览文件 @
5e496435
# Copyright (c) 20
18
PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 20
20
PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
examples/ocr/seq2seq_attn.py
浏览文件 @
5e496435
# Copyright (c) 20
18
PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 20
20
PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
examples/ocr/train.py
浏览文件 @
5e496435
# Copyright (c) 20
18
PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 20
20
PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -100,7 +100,7 @@ def main(FLAGS):
train_dataset
=
data
.
train
()
train_collate_fn
=
BatchCompose
(
[
data
.
Resize
(),
data
.
Normalize
(),
data
.
PadTarget
()])
train_sampler
=
data
.
My
BatchSampler
(
train_sampler
=
data
.
BatchSampler
(
train_dataset
,
batch_size
=
FLAGS
.
batch_size
,
shuffle
=
True
)
train_loader
=
fluid
.
io
.
DataLoader
(
train_dataset
,
...
...
@@ -112,7 +112,7 @@ def main(FLAGS):
test_dataset
=
data
.
test
()
test_collate_fn
=
BatchCompose
(
[
data
.
Resize
(),
data
.
Normalize
(),
data
.
PadTarget
()])
test_sampler
=
data
.
My
BatchSampler
(
test_sampler
=
data
.
BatchSampler
(
test_dataset
,
batch_size
=
FLAGS
.
batch_size
,
drop_last
=
False
,
...
...
examples/ocr/utility.py
浏览文件 @
5e496435
"""Contains common utility functions."""
# Copyright (c) 20
18
PaddlePaddle Authors. All Rights Reserve.
# Copyright (c) 20
20
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.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录