MapReader icon indicating copy to clipboard operation
MapReader copied to clipboard

Add text spotting

Open rwood-97 opened this issue 10 months ago • 2 comments

Summary

This PR begins the work of bringing text detection/recognition (ie. text spotting) into MapReader.

Addresses #358

Describe your changes

DeepSoloRunner is a class used for running the DeepSolo model on images. This produces polygons + text. DPTextDETRRunner is a class used for running the DPText-DETR model on images. This produces just polygons.

To do:

  • [x] Allow user to run on all patches in provided patch df
  • [x] Add plotting function
  • [x] Add docs for getting this running
  • [x] Check licences
  • [x] Add worked example
  • [ ] Add polygon merging code (?)

Checklist before assigning a reviewer (update as needed)

  • [x] Self-review code
  • [x] Ensure submission passes current tests
  • [ ] Add tests
  • [ ] Update relevant docs

Reviewer checklist

Please add anything you want reviewers to specifically focus/comment on.

  • [ ] Everything looks ok?

rwood-97 avatar Apr 10 '24 08:04 rwood-97

Codecov Report

Attention: Patch coverage is 6.16622% with 350 lines in your changes are missing coverage. Please review.

Project coverage is 62.12%. Comparing base (f3b151c) to head (6237341). Report is 6 commits behind head on main.

Files Patch % Lines
mapreader/spot_text/deepsolo_runner.py 4.02% 191 Missing :warning:
mapreader/spot_text/dptext_detr_runner.py 4.24% 158 Missing :warning:
mapreader/load/images.py 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #388      +/-   ##
==========================================
- Coverage   65.41%   62.12%   -3.29%     
==========================================
  Files          37       39       +2     
  Lines        6329     6701     +372     
==========================================
+ Hits         4140     4163      +23     
- Misses       2189     2538     +349     
Flag Coverage Δ
unittests 62.12% <6.16%> (-3.29%) :arrow_down:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Apr 10 '24 09:04 codecov-commenter

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@rwood-97 to test this here's what I think I need to do - please can you edit this list as needed:

  1. Check out the branch
  2. ~~Set up a conda env like this to install MapReader using this branch~~ Set up a conda env and do pip install .
  3. Install model dependencies outlined here
    • Only one of the models can be installed at a time
  4. Run the two notebooks from this PR locally and make sure everything works

edwardchalstrey1 avatar Apr 26 '24 08:04 edwardchalstrey1

In the DPTextDETR Pipeline.ipynb notebook, the line:

from mapreader.text_spot.dptext_detr_runner import DPTextDETRRunner

should be:

from mapreader.spot_text.dptext_detr_runner import DPTextDETRRunner

That line also failed initially (for me) because the timm dependency wasn't installed. I just did pip install timm in the same venv, and then it worked.

thobson88 avatar Apr 29 '24 12:04 thobson88