Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
g207004202
explainable-multimodal-classification
Commits
c5209365
Commit
c5209365
authored
May 11, 2021
by
cz1716
Browse files
add pragmas
parent
1b41bc63
Changes
2
Hide whitespace changes
Inline
Side-by-side
mmxai/text_removal/image_loader.py
View file @
c5209365
...
...
@@ -14,7 +14,7 @@ def loadImage(img):
img
=
Image
.
open
(
requests
.
get
(
img
,
stream
=
True
).
raw
)
else
:
img
=
Image
.
open
(
img
)
else
:
else
:
# pragma: no cover
sys
.
exit
(
"ERROR: Unsupported img type. Abort"
)
return
img
mmxai/text_removal/smart_text_removal.py
View file @
c5209365
...
...
@@ -52,7 +52,7 @@ class SmartTextRemover:
"""
# Create a new named window if required
if
show_boxes
:
if
show_boxes
:
# pragma: no cover
kWinName
=
"EAST: An Efficient and Accurate Scene Text Detector"
cv
.
namedWindow
(
kWinName
,
cv
.
WINDOW_NORMAL
)
...
...
@@ -106,7 +106,7 @@ class SmartTextRemover:
vertices_all
[
n
,
:,
:]
=
vertices
# Add the boxes to current frame if required
if
show_boxes
:
if
show_boxes
:
# pragma: no cover
for
j
in
range
(
4
):
p1
=
(
vertices
[
j
][
0
].
astype
(
int
),
vertices
[
j
][
1
].
astype
(
int
))
p2
=
(
...
...
@@ -116,7 +116,7 @@ class SmartTextRemover:
cv
.
line
(
img
,
p1
,
p2
,
(
0
,
255
,
0
),
1
)
# Display the image frame if required
if
show_boxes
:
if
show_boxes
:
# pragma: no cover
cv
.
imshow
(
kWinName
,
img
)
# waits for user to press any key
...
...
@@ -280,7 +280,7 @@ class SmartTextRemover:
return
[
detections
,
confidences
]
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
# pragma: no cover
remover
=
SmartTextRemover
(
"mmxai/text_removal/frozen_east_text_detection.pb"
)
img
=
remover
.
inpaint
(
"https://www.iqmetrix.com/hubfs/Meme%2021.jpg"
)
img
.
show
()
Write
Preview
Supports
Markdown
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