Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
be5fdae5
Commit
be5fdae5
authored
Apr 13, 2021
by
Jethong
Browse files
fix config format
parent
50bcec46
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
configs/e2e/e2e_r50_vd_pg.yml
configs/e2e/e2e_r50_vd_pg.yml
+2
-3
ppocr/data/pgnet_dataset.py
ppocr/data/pgnet_dataset.py
+4
-1
tools/infer/predict_e2e.py
tools/infer/predict_e2e.py
+1
-1
tools/infer_e2e.py
tools/infer_e2e.py
+1
-1
No files found.
configs/e2e/e2e_r50_vd_pg.yml
View file @
be5fdae5
...
@@ -69,10 +69,9 @@ Metric:
...
@@ -69,10 +69,9 @@ Metric:
Train
:
Train
:
dataset
:
dataset
:
name
:
PGDataSet
name
:
PGDataSet
data_dir
:
./train_data/
data_dir
:
./train_data/
train
label_file_list
:
[
.././train_data/total_text/train/
]
label_file_list
:
[
.././train_data/total_text/train/
]
ratio_list
:
[
1.0
]
ratio_list
:
[
1.0
]
data_format
:
icdar
#two data format: icdar/textnet
transforms
:
transforms
:
-
DecodeImage
:
# load image
-
DecodeImage
:
# load image
img_mode
:
BGR
img_mode
:
BGR
...
@@ -94,7 +93,7 @@ Train:
...
@@ -94,7 +93,7 @@ Train:
Eval
:
Eval
:
dataset
:
dataset
:
name
:
PGDataSet
name
:
PGDataSet
data_dir
:
./train_data/
data_dir
:
./train_data/
test
label_file_list
:
[
./train_data/total_text/test/
]
label_file_list
:
[
./train_data/total_text/test/
]
transforms
:
transforms
:
-
DecodeImage
:
# load image
-
DecodeImage
:
# load image
...
...
ppocr/data/pgnet_dataset.py
View file @
be5fdae5
...
@@ -78,7 +78,10 @@ class PGDataSet(Dataset):
...
@@ -78,7 +78,10 @@ class PGDataSet(Dataset):
file_name
=
substr
[
0
]
file_name
=
substr
[
0
]
label
=
substr
[
1
]
label
=
substr
[
1
]
img_path
=
os
.
path
.
join
(
self
.
data_dir
,
file_name
)
img_path
=
os
.
path
.
join
(
self
.
data_dir
,
file_name
)
img_id
=
int
(
data_line
.
split
(
"."
)[
0
][
3
:])
if
self
.
mode
.
lower
()
==
'eval'
:
img_id
=
int
(
data_line
.
split
(
"."
)[
0
][
7
:])
else
:
img_id
=
0
data
=
{
'img_path'
:
img_path
,
'label'
:
label
,
'img_id'
:
img_id
}
data
=
{
'img_path'
:
img_path
,
'label'
:
label
,
'img_id'
:
img_id
}
if
not
os
.
path
.
exists
(
img_path
):
if
not
os
.
path
.
exists
(
img_path
):
raise
Exception
(
"{} does not exist!"
.
format
(
img_path
))
raise
Exception
(
"{} does not exist!"
.
format
(
img_path
))
...
...
tools/infer/predict_e2e.py
View file @
be5fdae5
...
@@ -122,7 +122,7 @@ class TextE2E(object):
...
@@ -122,7 +122,7 @@ class TextE2E(object):
else
:
else
:
raise
NotImplementedError
raise
NotImplementedError
post_result
=
self
.
postprocess_op
(
preds
,
shape_list
)
post_result
=
self
.
postprocess_op
(
preds
,
shape_list
)
points
,
strs
=
post_result
[
'points'
],
post_result
[
'
str
s'
]
points
,
strs
=
post_result
[
'points'
],
post_result
[
'
text
s'
]
dt_boxes
=
self
.
filter_tag_det_res_only_clip
(
points
,
ori_im
.
shape
)
dt_boxes
=
self
.
filter_tag_det_res_only_clip
(
points
,
ori_im
.
shape
)
elapse
=
time
.
time
()
-
starttime
elapse
=
time
.
time
()
-
starttime
return
dt_boxes
,
strs
,
elapse
return
dt_boxes
,
strs
,
elapse
...
...
tools/infer_e2e.py
View file @
be5fdae5
...
@@ -103,7 +103,7 @@ def main():
...
@@ -103,7 +103,7 @@ def main():
images
=
paddle
.
to_tensor
(
images
)
images
=
paddle
.
to_tensor
(
images
)
preds
=
model
(
images
)
preds
=
model
(
images
)
post_result
=
post_process_class
(
preds
,
shape_list
)
post_result
=
post_process_class
(
preds
,
shape_list
)
points
,
strs
=
post_result
[
'points'
],
post_result
[
'
str
s'
]
points
,
strs
=
post_result
[
'points'
],
post_result
[
'
text
s'
]
# write resule
# write resule
dt_boxes_json
=
[]
dt_boxes_json
=
[]
for
poly
,
str
in
zip
(
points
,
strs
):
for
poly
,
str
in
zip
(
points
,
strs
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment