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
cc6c606f
Commit
cc6c606f
authored
Jun 12, 2020
by
LDOUBLEV
Browse files
discard export PYTHONPATH manually
parent
25189dcf
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
32 deletions
+37
-32
README.md
README.md
+0
-5
README_en.md
README_en.md
+0
-5
tools/eval.py
tools/eval.py
+5
-0
tools/export_model.py
tools/export_model.py
+3
-3
tools/infer/predict_det.py
tools/infer/predict_det.py
+6
-1
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+5
-0
tools/infer/predict_system.py
tools/infer/predict_system.py
+4
-3
tools/infer_det.py
tools/infer_det.py
+5
-4
tools/infer_rec.py
tools/infer_rec.py
+6
-8
tools/train.py
tools/train.py
+3
-3
No files found.
README.md
View file @
cc6c606f
...
@@ -69,11 +69,6 @@ cd ..
...
@@ -69,11 +69,6 @@ cd ..
```
bash
```
bash
# 设置PYTHONPATH环境变量
export
PYTHONPATH
=
.
# windows下设置环境变量
SET
PYTHONPATH
=
.
# 预测image_dir指定的单张图像
# 预测image_dir指定的单张图像
python3 tools/infer/predict_system.py
--image_dir
=
"./doc/imgs/11.jpg"
--det_model_dir
=
"./inference/ch_det_mv3_db/"
--rec_model_dir
=
"./inference/ch_rec_mv3_crnn/"
python3 tools/infer/predict_system.py
--image_dir
=
"./doc/imgs/11.jpg"
--det_model_dir
=
"./inference/ch_det_mv3_db/"
--rec_model_dir
=
"./inference/ch_rec_mv3_crnn/"
...
...
README_en.md
View file @
cc6c606f
...
@@ -69,11 +69,6 @@ The following code implements text detection and recognition inference tandemly.
...
@@ -69,11 +69,6 @@ The following code implements text detection and recognition inference tandemly.
```
bash
```
bash
# Set PYTHONPATH environment variable
export
PYTHONPATH
=
.
# Setting environment variable in Windows
SET
PYTHONPATH
=
.
# Prediction on a single image by specifying image path to image_dir
# Prediction on a single image by specifying image path to image_dir
python3 tools/infer/predict_system.py
--image_dir
=
"./doc/imgs/11.jpg"
--det_model_dir
=
"./inference/ch_det_mv3_db/"
--rec_model_dir
=
"./inference/ch_rec_mv3_crnn/"
python3 tools/infer/predict_system.py
--image_dir
=
"./doc/imgs/11.jpg"
--det_model_dir
=
"./inference/ch_det_mv3_db/"
--rec_model_dir
=
"./inference/ch_rec_mv3_crnn/"
...
...
tools/eval.py
View file @
cc6c606f
...
@@ -17,6 +17,11 @@ from __future__ import division
...
@@ -17,6 +17,11 @@ from __future__ import division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
os
import
os
import
sys
__dir__
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
))
def
set_paddle_flags
(
**
kwargs
):
def
set_paddle_flags
(
**
kwargs
):
...
...
tools/export_model.py
View file @
cc6c606f
...
@@ -18,9 +18,9 @@ from __future__ import print_function
...
@@ -18,9 +18,9 @@ from __future__ import print_function
import
os
import
os
import
sys
import
sys
import
time
__dir__
=
os
.
path
.
dirname
(
__file__
)
import
multiprocessing
sys
.
path
.
append
(
__dir__
)
import
numpy
as
np
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
))
def
set_paddle_flags
(
**
kwargs
):
def
set_paddle_flags
(
**
kwargs
):
...
...
tools/infer/predict_det.py
View file @
cc6c606f
...
@@ -11,8 +11,13 @@
...
@@ -11,8 +11,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
os
import
sys
__dir__
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'../..'
))
import
utility
import
tools.infer.utility
as
utility
from
ppocr.utils.utility
import
initial_logger
from
ppocr.utils.utility
import
initial_logger
logger
=
initial_logger
()
logger
=
initial_logger
()
from
ppocr.utils.utility
import
get_image_file_list
from
ppocr.utils.utility
import
get_image_file_list
...
...
tools/infer/predict_rec.py
View file @
cc6c606f
...
@@ -11,6 +11,11 @@
...
@@ -11,6 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
os
import
sys
__dir__
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'../..'
))
import
utility
import
utility
from
ppocr.utils.utility
import
initial_logger
from
ppocr.utils.utility
import
initial_logger
...
...
tools/infer/predict_system.py
View file @
cc6c606f
...
@@ -16,12 +16,13 @@ import sys
...
@@ -16,12 +16,13 @@ import sys
__dir__
=
os
.
path
.
dirname
(
__file__
)
__dir__
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'../..'
))
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'../..'
))
import
utility
import
tools.infer.utility
as
utility
from
ppocr.utils.utility
import
initial_logger
from
ppocr.utils.utility
import
initial_logger
logger
=
initial_logger
()
logger
=
initial_logger
()
import
cv2
import
cv2
import
predict_det
import
tools.infer.predict_det
as
predict_det
import
predict_rec
import
tools.infer.predict_rec
as
predict_rec
import
copy
import
copy
import
numpy
as
np
import
numpy
as
np
import
math
import
math
...
...
tools/infer_det.py
View file @
cc6c606f
...
@@ -16,14 +16,15 @@ from __future__ import absolute_import
...
@@ -16,14 +16,15 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
sys
import
time
import
numpy
as
np
import
numpy
as
np
from
copy
import
deepcopy
from
copy
import
deepcopy
import
json
import
json
# from paddle.fluid.contrib.model_stat import summary
import
os
import
sys
__dir__
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
))
def
set_paddle_flags
(
**
kwargs
):
def
set_paddle_flags
(
**
kwargs
):
...
...
tools/infer_rec.py
View file @
cc6c606f
...
@@ -16,10 +16,12 @@ from __future__ import absolute_import
...
@@ -16,10 +16,12 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
time
import
multiprocessing
import
numpy
as
np
import
numpy
as
np
import
os
import
sys
__dir__
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
))
def
set_paddle_flags
(
**
kwargs
):
def
set_paddle_flags
(
**
kwargs
):
...
@@ -35,10 +37,7 @@ set_paddle_flags(
...
@@ -35,10 +37,7 @@ set_paddle_flags(
FLAGS_eager_delete_tensor_gb
=
0
,
# enable GC to save memory
FLAGS_eager_delete_tensor_gb
=
0
,
# enable GC to save memory
)
)
from
paddle
import
fluid
import
tools.program
as
program
# from ppocr.utils.utility import load_config, merge_config
import
program
from
paddle
import
fluid
from
paddle
import
fluid
from
ppocr.utils.utility
import
initial_logger
from
ppocr.utils.utility
import
initial_logger
logger
=
initial_logger
()
logger
=
initial_logger
()
...
@@ -47,7 +46,6 @@ from ppocr.utils.save_load import init_model
...
@@ -47,7 +46,6 @@ from ppocr.utils.save_load import init_model
from
ppocr.utils.character
import
CharacterOps
from
ppocr.utils.character
import
CharacterOps
from
ppocr.utils.utility
import
create_module
from
ppocr.utils.utility
import
create_module
from
ppocr.utils.utility
import
get_image_file_list
from
ppocr.utils.utility
import
get_image_file_list
logger
=
initial_logger
()
def
main
():
def
main
():
...
...
tools/train.py
View file @
cc6c606f
...
@@ -18,9 +18,9 @@ from __future__ import print_function
...
@@ -18,9 +18,9 @@ from __future__ import print_function
import
os
import
os
import
sys
import
sys
import
time
__dir__
=
os
.
path
.
dirname
(
__file__
)
import
multiprocessing
sys
.
path
.
append
(
__dir__
)
import
numpy
as
np
sys
.
path
.
append
(
os
.
path
.
join
(
__dir__
,
'..'
))
def
set_paddle_flags
(
**
kwargs
):
def
set_paddle_flags
(
**
kwargs
):
...
...
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