Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
7653f384
authored
2024-09-25 18:36:55 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ADD:log
1 parent
6027ea34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/management/commands/ocr_process.py
View file @
7653f38
...
...
@@ -1675,16 +1675,20 @@ class Command(BaseCommand, LoggerMixin):
path_split
=
img_path
.
split
(
'/'
)
task_str
=
consts
.
SPLIT_STR
.
join
((
path_split
[
-
5
],
path_split
[
-
3
]))
self
.
online_log
.
info
(
'{0} [before lock] [img={1}] '
.
format
(
self
.
log_base
,
img_path
))
with
lock
:
self
.
online_log
.
info
(
'{0} [get lock] [img={1}] '
.
format
(
self
.
log_base
,
img_path
))
doc_res_dict
=
res_dict
.
setdefault
(
task_str
,
{})
doc_res_dict
[
img_path
]
=
ocr_1_res
res_dict
[
task_str
]
=
doc_res_dict
todo_count
=
todo_count_dict
.
get
(
task_str
)
if
todo_count
==
1
:
finish_queue
.
put
(
task_str
)
self
.
online_log
.
info
(
'{0} [ocr_1 to finish_queue] [img={1}] '
.
format
(
self
.
log_base
,
img_path
))
del
todo_count_dict
[
task_str
]
else
:
todo_count_dict
[
task_str
]
=
todo_count
-
1
self
.
online_log
.
info
(
'{0} [after lock] [img={1}] '
.
format
(
self
.
log_base
,
img_path
))
except
Exception
as
e
:
self
.
online_log
.
error
(
'{0} [process error (store ocr res)] [img_path={1}] [error={2}]'
.
format
(
self
.
log_base
,
img_path
,
traceback
.
format_exc
()))
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment