-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Description
Describe the bug
visualizer.get_box
below is a duplicate of utils_visual.bbox_from_span
fonduer/src/fonduer/utils/visualizer.py
Lines 107 to 115 in 0bbd438
def get_box(span: SpanMention) -> Bbox: | |
"""Get the bounding box.""" | |
return Bbox( | |
min(span.get_attrib_tokens("page")), | |
min(span.get_attrib_tokens("top")), | |
min(span.get_attrib_tokens("left")), | |
max(span.get_attrib_tokens("bottom")), | |
max(span.get_attrib_tokens("right")), | |
) |
fonduer/src/fonduer/utils/utils_visual.py
Lines 15 to 31 in 0bbd438
def bbox_from_span(span) -> Bbox: # type: ignore | |
warnings.warn( | |
"bbox_from_span(span) is deprecated. Use span.get_bbox() instead.", | |
DeprecationWarning, | |
) | |
from fonduer.candidates.models.span_mention import TemporarySpanMention # noqa | |
if isinstance(span, TemporarySpanMention) and span.sentence.is_visual(): | |
return Bbox( | |
span.get_attrib_tokens("page")[0], | |
min(span.get_attrib_tokens("top")), | |
max(span.get_attrib_tokens("bottom")), | |
min(span.get_attrib_tokens("left")), | |
max(span.get_attrib_tokens("right")), | |
) | |
else: | |
return None |
utils_visual.bbox_from_span
is now deprecated. So should visualizer.get_box
.
To Reproduce
N/A
Expected behavior
visualizer.get_box
is deprecated.
Error Logs/Screenshots
N/A
Environment (please complete the following information):
- Fonduer Version: 0.8.2
Additional context
utils_visual.bbox_from_span
got now deprecated by #429.
Metadata
Metadata
Assignees
Labels
No labels