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
85a98fe2
Commit
85a98fe2
authored
May 12, 2021
by
tink2123
Browse files
Merge branch 'dygraph' of
https://github.com/PaddlePaddle/PaddleOCR
into dygraph
parents
d517e1b7
f8889760
Changes
226
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
11037 additions
and
11047 deletions
+11037
-11047
.gitignore
.gitignore
+5
-1
MANIFEST.in
MANIFEST.in
+2
-1
PPOCRLabel/PPOCRLabel.py
PPOCRLabel/PPOCRLabel.py
+20
-10
PPOCRLabel/README.md
PPOCRLabel/README.md
+1
-3
PPOCRLabel/README_ch.md
PPOCRLabel/README_ch.md
+1
-1
PPOCRLabel/libs/canvas.py
PPOCRLabel/libs/canvas.py
+1
-1
PPOCRLabel/libs/resources.py
PPOCRLabel/libs/resources.py
+10984
-10982
PPOCRLabel/libs/utils.py
PPOCRLabel/libs/utils.py
+9
-0
PPOCRLabel/resources/strings/strings-zh-CN.properties
PPOCRLabel/resources/strings/strings-zh-CN.properties
+1
-0
PPOCRLabel/resources/strings/strings.properties
PPOCRLabel/resources/strings/strings.properties
+2
-1
README.md
README.md
+2
-1
README_ch.md
README_ch.md
+6
-4
configs/det/ch_ppocr_v2.0/ch_det_mv3_db_v2.0.yml
configs/det/ch_ppocr_v2.0/ch_det_mv3_db_v2.0.yml
+0
-5
configs/det/ch_ppocr_v2.0/ch_det_res18_db_v2.0.yml
configs/det/ch_ppocr_v2.0/ch_det_res18_db_v2.0.yml
+0
-5
configs/det/det_mv3_db.yml
configs/det/det_mv3_db.yml
+0
-5
configs/det/det_mv3_east.yml
configs/det/det_mv3_east.yml
+0
-5
configs/det/det_r50_vd_db.yml
configs/det/det_r50_vd_db.yml
+0
-5
configs/det/det_r50_vd_east.yml
configs/det/det_r50_vd_east.yml
+0
-5
configs/det/det_r50_vd_sast_icdar15.yml
configs/det/det_r50_vd_sast_icdar15.yml
+3
-7
configs/det/det_r50_vd_sast_totaltext.yml
configs/det/det_r50_vd_sast_totaltext.yml
+0
-5
No files found.
.gitignore
View file @
85a98fe2
...
...
@@ -25,3 +25,7 @@ output/
build/
dist/
paddleocr.egg-info/
/deploy/android_demo/app/OpenCV/
/deploy/android_demo/app/PaddleLite/
/deploy/android_demo/app/.cxx/
/deploy/android_demo/app/cache/
MANIFEST.in
View file @
85a98fe2
...
...
@@ -5,3 +5,4 @@ recursive-include ppocr/utils *.txt utility.py logging.py
recursive-include ppocr/data/ *.py
recursive-include ppocr/postprocess *.py
recursive-include tools/infer *.py
recursive-include ppocr/utils/e2e_utils/ *.py
\ No newline at end of file
PPOCRLabel/PPOCRLabel.py
View file @
85a98fe2
...
...
@@ -147,6 +147,7 @@ class MainWindow(QMainWindow, WindowMixin):
self
.
itemsToShapesbox
=
{}
self
.
shapesToItemsbox
=
{}
self
.
prevLabelText
=
getStr
(
'tempLabel'
)
self
.
noLabelText
=
getStr
(
'nullLabel'
)
self
.
model
=
'paddle'
self
.
PPreader
=
None
self
.
autoSaveNum
=
5
...
...
@@ -1020,7 +1021,7 @@ class MainWindow(QMainWindow, WindowMixin):
item
.
setText
(
str
([(
int
(
p
.
x
()),
int
(
p
.
y
()))
for
p
in
shape
.
points
]))
self
.
updateComboBox
()
def
updateComboBox
(
self
):
# TODO:貌似没用
def
updateComboBox
(
self
):
# Get the unique labels and add them to the Combobox.
itemsTextList
=
[
str
(
self
.
labelList
.
item
(
i
).
text
())
for
i
in
range
(
self
.
labelList
.
count
())]
...
...
@@ -1040,7 +1041,7 @@ class MainWindow(QMainWindow, WindowMixin):
return
dict
(
label
=
s
.
label
,
# str
line_color
=
s
.
line_color
.
getRgb
(),
fill_color
=
s
.
fill_color
.
getRgb
(),
points
=
[(
p
.
x
(),
p
.
y
())
for
p
in
s
.
points
],
# QPonitF
points
=
[(
int
(
p
.
x
()
)
,
int
(
p
.
y
())
)
for
p
in
s
.
points
],
# QPonitF
# add chris
difficult
=
s
.
difficult
)
# bool
...
...
@@ -1069,7 +1070,7 @@ class MainWindow(QMainWindow, WindowMixin):
# print('Image:{0} -> Annotation:{1}'.format(self.filePath, annotationFilePath))
return
True
except
:
self
.
errorMessage
(
u
'Error saving label data'
)
self
.
errorMessage
(
u
'Error saving label
data'
,
u
'Error saving label
data'
)
return
False
def
copySelectedShape
(
self
):
...
...
@@ -1802,7 +1803,11 @@ class MainWindow(QMainWindow, WindowMixin):
result
.
insert
(
0
,
box
)
print
(
'result in reRec is '
,
result
)
self
.
result_dic
.
append
(
result
)
if
result
[
1
][
0
]
==
shape
.
label
:
else
:
print
(
'Can not recognise the box'
)
self
.
result_dic
.
append
([
box
,(
self
.
noLabelText
,
0
)])
if
self
.
noLabelText
==
shape
.
label
or
result
[
1
][
0
]
==
shape
.
label
:
print
(
'label no change'
)
else
:
rec_flag
+=
1
...
...
@@ -1836,9 +1841,14 @@ class MainWindow(QMainWindow, WindowMixin):
print
(
'label no change'
)
else
:
shape
.
label
=
result
[
1
][
0
]
else
:
print
(
'Can not recognise the box'
)
if
self
.
noLabelText
==
shape
.
label
:
print
(
'label no change'
)
else
:
shape
.
label
=
self
.
noLabelText
self
.
singleLabel
(
shape
)
self
.
setDirty
()
print
(
box
)
def
autolcm
(
self
):
vbox
=
QVBoxLayout
()
...
...
PPOCRLabel/README.md
View file @
85a98fe2
...
...
@@ -29,9 +29,7 @@ PaddleOCR models has been built in PPOCRLabel, please refer to [PaddleOCR instal
### 2. Install PPOCRLabel
#### Windows + Anaconda
Download and install
[
Anaconda
](
https://www.anaconda.com/download/#download
)
(
Python
3+)
#### Windows
```
pip install pyqt5
...
...
PPOCRLabel/README_ch.md
View file @
85a98fe2
...
...
@@ -31,7 +31,7 @@ PPOCRLabel是一款适用于OCR领域的半自动化图形标注工具,内置P
PPOCRLabel内置PaddleOCR模型,故请参考
[
PaddleOCR安装文档
](
https://github.com/PaddlePaddle/PaddleOCR/blob/develop/doc/doc_ch/installation.md
)
准备好PaddleOCR,并确保PaddleOCR安装成功。
### 2. 安装PPOCRLabel
#### Windows
+ Anaconda
#### Windows
```
pip install pyqt5
...
...
PPOCRLabel/libs/canvas.py
View file @
85a98fe2
...
...
@@ -45,7 +45,7 @@ class Canvas(QWidget):
CREATE
,
EDIT
=
list
(
range
(
2
))
_fill_drawing
=
False
# draw shadows
epsilon
=
11
.0
epsilon
=
5
.0
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
Canvas
,
self
).
__init__
(
*
args
,
**
kwargs
)
...
...
PPOCRLabel/libs/resources.py
View file @
85a98fe2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
PPOCRLabel/libs/utils.py
View file @
85a98fe2
...
...
@@ -124,6 +124,15 @@ def natural_sort(list, key=lambda s:s):
def
get_rotate_crop_image
(
img
,
points
):
# Use Green's theory to judge clockwise or counterclockwise
# author: biyanhua
d
=
0.0
for
index
in
range
(
-
1
,
3
):
d
+=
-
0.5
*
(
points
[
index
+
1
][
1
]
+
points
[
index
][
1
])
*
(
points
[
index
+
1
][
0
]
-
points
[
index
][
0
])
if
d
<
0
:
# counterclockwise
tmp
=
np
.
array
(
points
)
points
[
1
],
points
[
3
]
=
tmp
[
3
],
tmp
[
1
]
try
:
img_crop_width
=
int
(
...
...
PPOCRLabel/resources/strings/strings-zh-CN.properties
View file @
85a98fe2
...
...
@@ -87,6 +87,7 @@ creatPolygon=四点标注
drawSquares
=
正方形标注
saveRec
=
保存识别结果
tempLabel
=
待识别
nullLabel
=
无法识别
steps
=
操作步骤
choseModelLg
=
选择模型语言
cancel
=
取消
...
...
PPOCRLabel/resources/strings/strings.properties
View file @
85a98fe2
...
...
@@ -77,7 +77,7 @@ IR=Image Resize
autoRecognition
=
Auto Recognition
reRecognition
=
Re-recognition
mfile
=
File
medit
=
E
i
dt
medit
=
Ed
i
t
mview
=
View
mhelp
=
Help
iconList
=
Icon List
...
...
@@ -87,6 +87,7 @@ creatPolygon=Create Quadrilateral
drawSquares
=
Draw Squares
saveRec
=
Save Recognition Result
tempLabel
=
TEMPORARY
nullLabel
=
NULL
steps
=
Steps
choseModelLg
=
Choose Model Language
cancel
=
Cancel
...
...
README.md
View file @
85a98fe2
...
...
@@ -32,7 +32,8 @@ PaddleOCR supports both dynamic graph and static graph programming paradigm
<div
align=
"center"
>
<img
src=
"doc/imgs_results/ch_ppocr_mobile_v2.0/test_add_91.jpg"
width=
"800"
>
<img
src=
"doc/imgs_results/ch_ppocr_mobile_v2.0/00018069.jpg"
width=
"800"
>
<img
src=
"doc/imgs_results/multi_lang/img_01.jpg"
width=
"800"
>
<img
src=
"doc/imgs_results/multi_lang/img_02.jpg"
width=
"800"
>
</div>
The above pictures are the visualizations of the general ppocr_server model. For more effect pictures, please see
[
More visualizations
](
./doc/doc_en/visualization_en.md
)
.
...
...
README_ch.md
View file @
85a98fe2
...
...
@@ -8,9 +8,9 @@ PaddleOCR同时支持动态图与静态图两种编程范式
-
静态图版本:develop分支
**近期更新**
-
2021.4.8 release 2.1版本,新增AAAI 2021论文
[
端到端识别算法PGNet
](
./doc/doc_ch/pgnet.md
)
开源,
[
多语言模型
](
./doc/doc_ch/multi_languages.md
)
支持种类增加到80+。
-
2021.2.1
[
FAQ
](
./doc/doc_ch/FAQ.md
)
新增5个高频问题,总数162个,每周一都会更新,欢迎大家持续关注。
-
2021.1.26,28,29 PaddleOCR官方研发团队带来技术深入解读三日直播课,1月26日、28日、29日晚上19:30,
[
直播地址
](
https://live.bilibili.com/21689802
)
-
2021.1.21 更新多语言识别模型,目前支持语种超过27种,
[
多语言模型下载
](
./doc/doc_ch/models_list.md
)
,包括中文简体、中文繁体、英文、法文、德文、韩文、日文、意大利文、西班牙文、葡萄牙文、俄罗斯文、阿拉伯文等,后续计划可以参考
[
多语言研发计划
](
https://github.com/PaddlePaddle/PaddleOCR/issues/1048
)
-
2021.1.21 更新多语言识别模型,目前支持语种超过27种,包括中文简体、中文繁体、英文、法文、德文、韩文、日文、意大利文、西班牙文、葡萄牙文、俄罗斯文、阿拉伯文等,后续计划可以参考
[
多语言研发计划
](
https://github.com/PaddlePaddle/PaddleOCR/issues/1048
)
-
2020.12.15 更新数据合成工具
[
Style-Text
](
./StyleText/README_ch.md
)
,可以批量合成大量与目标场景类似的图像,在多个场景验证,效果明显提升。
-
2020.11.25 更新半自动标注工具
[
PPOCRLabel
](
./PPOCRLabel/README_ch.md
)
,辅助开发者高效完成标注任务,输出格式与PP-OCR训练任务完美衔接。
-
2020.9.22 更新PP-OCR技术文章,https://arxiv.org/abs/2009.09941
...
...
@@ -74,11 +74,13 @@ PaddleOCR同时支持动态图与静态图两种编程范式
## 文档教程
-
[
快速安装
](
./doc/doc_ch/installation.md
)
-
[
中文OCR模型快速使用
](
./doc/doc_ch/quickstart.md
)
-
[
多语言OCR模型快速使用
](
./doc/doc_ch/multi_languages.md
)
-
[
代码组织结构
](
./doc/doc_ch/tree.md
)
-
算法介绍
-
[
文本检测
](
./doc/doc_ch/algorithm_overview.md
)
-
[
文本识别
](
./doc/doc_ch/algorithm_overview.md
)
-
[
PP-OCR Pipline
](
#PP-OCR
)
-
[
PP-OCR Pipeline
](
#PP-OCR
)
-
[
端到端PGNet算法
](
./doc/doc_ch/pgnet.md
)
-
模型训练/评估
-
[
文本检测
](
./doc/doc_ch/detection.md
)
-
[
文本识别
](
./doc/doc_ch/recognition.md
)
...
...
@@ -112,7 +114,7 @@ PaddleOCR同时支持动态图与静态图两种编程范式
<a
name=
"PP-OCR"
></a>
## PP-OCR Pipline
## PP-OCR Pip
e
line
<div
align=
"center"
>
<img
src=
"./doc/ppocr_framework.png"
width=
"800"
>
</div>
...
...
configs/det/ch_ppocr_v2.0/ch_det_mv3_db_v2.0.yml
View file @
85a98fe2
...
...
@@ -7,11 +7,6 @@ Global:
save_epoch_step
:
1200
# evaluation is run every 5000 iterations after the 4000th iteration
eval_batch_step
:
[
3000
,
2000
]
# 1. If pretrained_model is saved in static mode, such as classification pretrained model
# from static branch, load_static_weights must be set as True.
# 2. If you want to finetune the pretrained models we provide in the docs,
# you should set load_static_weights as False.
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/MobileNetV3_large_x0_5_pretrained
checkpoints
:
...
...
configs/det/ch_ppocr_v2.0/ch_det_res18_db_v2.0.yml
View file @
85a98fe2
...
...
@@ -7,11 +7,6 @@ Global:
save_epoch_step
:
1200
# evaluation is run every 5000 iterations after the 4000th iteration
eval_batch_step
:
[
3000
,
2000
]
# 1. If pretrained_model is saved in static mode, such as classification pretrained model
# from static branch, load_static_weights must be set as True.
# 2. If you want to finetune the pretrained models we provide in the docs,
# you should set load_static_weights as False.
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/ResNet18_vd_pretrained
checkpoints
:
...
...
configs/det/det_mv3_db.yml
View file @
85a98fe2
...
...
@@ -7,11 +7,6 @@ Global:
save_epoch_step
:
1200
# evaluation is run every 2000 iterations
eval_batch_step
:
[
0
,
2000
]
# 1. If pretrained_model is saved in static mode, such as classification pretrained model
# from static branch, load_static_weights must be set as True.
# 2. If you want to finetune the pretrained models we provide in the docs,
# you should set load_static_weights as False.
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/MobileNetV3_large_x0_5_pretrained
checkpoints
:
...
...
configs/det/det_mv3_east.yml
View file @
85a98fe2
...
...
@@ -7,11 +7,6 @@ Global:
save_epoch_step
:
1000
# evaluation is run every 5000 iterations after the 4000th iteration
eval_batch_step
:
[
4000
,
5000
]
# 1. If pretrained_model is saved in static mode, such as classification pretrained model
# from static branch, load_static_weights must be set as True.
# 2. If you want to finetune the pretrained models we provide in the docs,
# you should set load_static_weights as False.
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/MobileNetV3_large_x0_5_pretrained
checkpoints
:
...
...
configs/det/det_r50_vd_db.yml
View file @
85a98fe2
...
...
@@ -7,11 +7,6 @@ Global:
save_epoch_step
:
1200
# evaluation is run every 2000 iterations
eval_batch_step
:
[
0
,
2000
]
# 1. If pretrained_model is saved in static mode, such as classification pretrained model
# from static branch, load_static_weights must be set as True.
# 2. If you want to finetune the pretrained models we provide in the docs,
# you should set load_static_weights as False.
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/ResNet50_vd_ssld_pretrained
checkpoints
:
...
...
configs/det/det_r50_vd_east.yml
View file @
85a98fe2
...
...
@@ -7,11 +7,6 @@ Global:
save_epoch_step
:
1000
# evaluation is run every 5000 iterations after the 4000th iteration
eval_batch_step
:
[
4000
,
5000
]
# 1. If pretrained_model is saved in static mode, such as classification pretrained model
# from static branch, load_static_weights must be set as True.
# 2. If you want to finetune the pretrained models we provide in the docs,
# you should set load_static_weights as False.
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/ResNet50_vd_pretrained/
checkpoints
:
...
...
configs/det/det_r50_vd_sast_icdar15.yml
View file @
85a98fe2
...
...
@@ -7,11 +7,6 @@ Global:
save_epoch_step
:
1000
# evaluation is run every 5000 iterations after the 4000th iteration
eval_batch_step
:
[
4000
,
5000
]
# 1. If pretrained_model is saved in static mode, such as classification pretrained model
# from static branch, load_static_weights must be set as True.
# 2. If you want to finetune the pretrained models we provide in the docs,
# you should set load_static_weights as False.
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/ResNet50_vd_ssld_pretrained/
checkpoints
:
...
...
@@ -20,6 +15,7 @@ Global:
infer_img
:
save_res_path
:
./output/sast_r50_vd_ic15/predicts_sast.txt
Architecture
:
model_type
:
det
algorithm
:
SAST
...
...
configs/det/det_r50_vd_sast_totaltext.yml
View file @
85a98fe2
...
...
@@ -7,11 +7,6 @@ Global:
save_epoch_step
:
1000
# evaluation is run every 5000 iterations after the 4000th iteration
eval_batch_step
:
[
4000
,
5000
]
# 1. If pretrained_model is saved in static mode, such as classification pretrained model
# from static branch, load_static_weights must be set as True.
# 2. If you want to finetune the pretrained models we provide in the docs,
# you should set load_static_weights as False.
load_static_weights
:
True
cal_metric_during_train
:
False
pretrained_model
:
./pretrain_models/ResNet50_vd_ssld_pretrained/
checkpoints
:
...
...
Prev
1
2
3
4
5
…
12
Next
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