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
752a277a
Unverified
Commit
752a277a
authored
May 08, 2022
by
MissPenguin
Committed by
GitHub
May 08, 2022
Browse files
Merge branch 'dygraph' into dygraph
parents
8ae07313
2acde6c5
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
doc/imgs_words/arabic/ar_2.jpg
doc/imgs_words/arabic/ar_2.jpg
+0
-0
paddleocr.py
paddleocr.py
+62
-2
No files found.
doc/imgs_words/arabic/ar_2.jpg
View replaced file @
8ae07313
View file @
752a277a
3.62 KB
|
W:
|
H:
13.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
paddleocr.py
View file @
752a277a
...
...
@@ -67,6 +67,10 @@ MODEL_URLS = {
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_det_infer.tar'
,
},
'ml'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/Multilingual_PP-OCRv3_det_infer.tar'
}
},
'rec'
:
{
'ch'
:
{
...
...
@@ -79,6 +83,56 @@ MODEL_URLS = {
'https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/en_dict.txt'
},
'korean'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/korean_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/korean_dict.txt'
},
'japan'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/japan_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/japan_dict.txt'
},
'chinese_cht'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/chinese_cht_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/chinese_cht_dict.txt'
},
'ta'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/ta_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/ta_dict.txt'
},
'te'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/te_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/te_dict.txt'
},
'ka'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/ka_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/ka_dict.txt'
},
'latin'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/latin_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/latin_dict.txt'
},
'arabic'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/arabic_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/arabic_dict.txt'
},
'cyrillic'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/cyrillic_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/cyrillic_dict.txt'
},
'devanagari'
:
{
'url'
:
'https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/devanagari_PP-OCRv3_rec_infer.tar'
,
'dict_path'
:
'./ppocr/utils/dict/devanagari_dict.txt'
},
},
'cls'
:
{
'ch'
:
{
...
...
@@ -259,7 +313,7 @@ def parse_lang(lang):
'af'
,
'az'
,
'bs'
,
'cs'
,
'cy'
,
'da'
,
'de'
,
'es'
,
'et'
,
'fr'
,
'ga'
,
'hr'
,
'hu'
,
'id'
,
'is'
,
'it'
,
'ku'
,
'la'
,
'lt'
,
'lv'
,
'mi'
,
'ms'
,
'mt'
,
'nl'
,
'no'
,
'oc'
,
'pi'
,
'pl'
,
'pt'
,
'ro'
,
'rs_latin'
,
'sk'
,
'sl'
,
'sq'
,
'sv'
,
'sw'
,
'tl'
,
'tr'
,
'uz'
,
'vi'
'sw'
,
'tl'
,
'tr'
,
'uz'
,
'vi'
,
'french'
,
'german'
]
arabic_lang
=
[
'ar'
,
'fa'
,
'ug'
,
'ur'
]
cyrillic_lang
=
[
...
...
@@ -285,8 +339,10 @@ def parse_lang(lang):
det_lang
=
"ch"
elif
lang
==
'structure'
:
det_lang
=
'structure'
el
se
:
el
if
lang
in
[
"en"
,
"latin"
]
:
det_lang
=
"en"
else
:
det_lang
=
"ml"
return
lang
,
det_lang
...
...
@@ -356,6 +412,10 @@ class PaddleOCR(predict_system.TextSystem):
params
.
cls_model_dir
,
cls_url
=
confirm_model_dir_url
(
params
.
cls_model_dir
,
os
.
path
.
join
(
BASE_DIR
,
'whl'
,
'cls'
),
cls_model_config
[
'url'
])
if
params
.
ocr_version
==
'PP-OCRv3'
:
params
.
rec_image_shape
=
"3, 48, 320"
else
:
params
.
rec_image_shape
=
"3, 32, 320"
# download model
maybe_download
(
params
.
det_model_dir
,
det_url
)
maybe_download
(
params
.
rec_model_dir
,
rec_url
)
...
...
Prev
1
2
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