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
c2671079
Commit
c2671079
authored
Jan 19, 2022
by
HinGwenWoong
Browse files
Add [ time left ] while predicting the image for user to know the situation
parent
d843d59e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
PPOCRLabel/libs/autoDialog.py
PPOCRLabel/libs/autoDialog.py
+10
-1
No files found.
PPOCRLabel/libs/autoDialog.py
View file @
c2671079
...
...
@@ -6,6 +6,8 @@ except ImportError:
from
PyQt4.QtGui
import
*
from
PyQt4.QtCore
import
*
import
time
import
datetime
import
json
import
cv2
import
numpy
as
np
...
...
@@ -80,8 +82,9 @@ class AutoDialog(QDialog):
self
.
parent
=
parent
self
.
ocr
=
ocr
self
.
mImgList
=
mImgList
self
.
lender
=
lenbar
self
.
pb
=
QProgressBar
()
self
.
pb
.
setRange
(
0
,
len
ba
r
)
self
.
pb
.
setRange
(
0
,
self
.
len
de
r
)
self
.
pb
.
setValue
(
0
)
layout
=
QVBoxLayout
()
...
...
@@ -108,10 +111,16 @@ class AutoDialog(QDialog):
self
.
thread_1
.
progressBarValue
.
connect
(
self
.
handleProgressBarSingal
)
self
.
thread_1
.
listValue
.
connect
(
self
.
handleListWidgetSingal
)
self
.
thread_1
.
endsignal
.
connect
(
self
.
handleEndsignalSignal
)
self
.
time_start
=
time
.
time
()
# save start time
def
handleProgressBarSingal
(
self
,
i
):
self
.
pb
.
setValue
(
i
)
# calculate time left of auto labeling
avg_time
=
(
time
.
time
()
-
self
.
time_start
)
/
i
# Use average time to prevent time fluctuations
time_left
=
str
(
datetime
.
timedelta
(
seconds
=
avg_time
*
(
self
.
lender
-
i
)))
self
.
setWindowTitle
(
"PPOCRLabel -- "
+
f
"Time Left:
{
time_left
}
"
)
# show
def
handleListWidgetSingal
(
self
,
i
):
self
.
listWidget
.
addItem
(
i
)
titem
=
self
.
listWidget
.
item
(
self
.
listWidget
.
count
()
-
1
)
...
...
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