Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize Drawing object every page not to carry over drawings to the following pages #488

Merged
merged 2 commits into from
Jul 25, 2020

Conversation

HiromuHota
Copy link
Contributor

@HiromuHota HiromuHota commented Jul 25, 2020

Description of the problems or issues

Is your pull request related to a problem? Please describe.

Expected behavior

When displaying candidates like below, the candidates are highlighted by surrounding rectangles.

from hardware_utils import entity_to_candidates
vis = Visualizer(pdf_path)
vis.display_candidates(cands)

Actual behavior

When displaying multiple candidates that span multiple pages, rectangles are drawn not on the right page but also on the following pages.

Does your pull request fix any issue.

N/A.

Description of the proposed changes

Initialize Drawing object every page not to carry over drawings to the following pages

Test plan

Run the hardware tutorial and see the result manually.

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the CHANGELOG.rst accordingly.

@HiromuHota
Copy link
Contributor Author

The hardware tutorial can demonstrates the issue.
The blue rectangle for "BC182BG" is drawn both on the first page and on the second page.

image
image

@HiromuHota
Copy link
Contributor Author

This is the result with this patch:

image
image

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2020

Codecov Report

Merging #488 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #488   +/-   ##
=======================================
  Coverage   85.82%   85.83%           
=======================================
  Files          88       88           
  Lines        4558     4559    +1     
  Branches      848      848           
=======================================
+ Hits         3912     3913    +1     
  Misses        464      464           
  Partials      182      182           
Flag Coverage Δ
#unittests 85.83% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/fonduer/utils/visualizer.py 80.00% <100.00%> (+0.27%) ⬆️

@HiromuHota HiromuHota marked this pull request as ready for review July 25, 2020 00:53
@senwu senwu merged commit 285e328 into HazyResearch:master Jul 25, 2020
@HiromuHota HiromuHota deleted the fix/visualizer branch July 25, 2020 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants