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
ModelZoo
crnn_pytorch
Commits
dc8c4458
Commit
dc8c4458
authored
Oct 09, 2024
by
dengjb
Browse files
Update utils.py
parent
0b1180d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
utils.py
utils.py
+2
-2
No files found.
utils.py
View file @
dc8c4458
...
...
@@ -45,7 +45,7 @@ class strLabelConverter(object):
for
char
in
text
]
length
=
[
len
(
text
)]
el
if
isinstance
(
text
,
collections
.
Iterable
)
:
el
se
:
length
=
[
len
(
s
)
for
s
in
text
]
text
=
''
.
join
(
text
)
text
,
_
=
self
.
encode
(
text
)
...
...
@@ -170,4 +170,4 @@ class AverageMeter(object):
self
.
val
=
val
self
.
sum
+=
val
*
n
self
.
count
+=
n
self
.
avg
=
self
.
sum
/
self
.
count
\ No newline at end of file
self
.
avg
=
self
.
sum
/
self
.
count
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