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

[detection] move padding removal directly to detection #1627

Merged
merged 5 commits into from
Jun 5, 2024

Conversation

felixdittrich92
Copy link
Contributor

@felixdittrich92 felixdittrich92 commented Jun 2, 2024

This PR:

  • make padding removal part of the detection predictor
  • make the detection_predictor standalone (before the user has to do the padding removal on it's on which is not correct)
  • update API now the detection results are the same with ocr_predictor and detection_predictor

Any feedback is welcome 🤗

CC @ArsalanYounus007 @yumikim381

Note: again API will fail until merged ^^

ref.: #1619 #1622

@felixdittrich92 felixdittrich92 added type: enhancement Improvement module: models Related to doctr.models ext: api Related to api folder topic: text detection Related to the task of text detection labels Jun 2, 2024
@felixdittrich92 felixdittrich92 added this to the 0.9.0 milestone Jun 2, 2024
@felixdittrich92 felixdittrich92 self-assigned this Jun 2, 2024
],
},
"poly": {
"name": "117319856-fc35bf00-ae8b-11eb-9b51-ca5aba673466.jpg",
"geometries": [
[
0.7873152494430542,
0.9063061475753784,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comparison with ocr_predictor:

"words": [
    {
        "value": "Hello",
        "geometry": [0.7471996155154171, 0.1796875, 0.8272978149561669, 0.20703125],
        "confidence": 1,
        "crop_orientation": {"value": 0, "confidence": None},
    },
    {
        "value": "world!",
        "geometry": [
            0.8176307908857315,
            0.1787109375,
            0.9101580212741838,
            0.2080078125,
        ],
        "confidence": 1,
        "crop_orientation": {"value": 0, "confidence": None},
    },
],
"words": [
    {
        "value": "Hello",
        "geometry": [
            0.7453157305717468,
            0.1800299733877182,
            0.8233299851417542,
            0.17740298807621002,
            0.8250390291213989,
            0.2027825564146042,
            0.7470247745513916,
            0.20540954172611237,
        ],
        "confidence": 0.99,
        "crop_orientation": {"value": 0, "confidence": 1},
    },
    {
        "value": "world!",
        "geometry": [
            0.8157618045806885,
            0.18002046644687653,
            0.9063061475753784,
            0.17740710079669952,
            0.9078840017318726,
            0.20474515855312347,
            0.8173396587371826,
            0.20735852420330048,
        ],
        "confidence": 1,
        "crop_orientation": {"value": 0, "confidence": 1},
    },
],

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why geometry changed so much ?

Copy link
Contributor Author

@felixdittrich92 felixdittrich92 Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@odulcy-mindee this was wrong before because remove padding was only in ocr_predictor (after detection predictor)

Now it's correct the detection results are the same with detection_predictor standalone and ocr_predictor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref.: #1619 #1622 :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's clearer, thank you

Copy link

codecov bot commented Jun 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.38%. Comparing base (9c92f5c) to head (c1d6a36).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1627      +/-   ##
==========================================
+ Coverage   96.25%   96.38%   +0.13%     
==========================================
  Files         163      164       +1     
  Lines        7707     7716       +9     
==========================================
+ Hits         7418     7437      +19     
+ Misses        289      279      -10     
Flag Coverage Δ
unittests 96.38% <100.00%> (+0.13%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@felixdittrich92 felixdittrich92 marked this pull request as ready for review June 3, 2024 07:10
@felixT2K
Copy link
Contributor

felixT2K commented Jun 4, 2024

Included mypy fixes for new version

@felixdittrich92 felixdittrich92 merged commit 5eda559 into mindee:main Jun 5, 2024
79 of 81 checks passed
@felixdittrich92 felixdittrich92 deleted the det-remove-pad branch June 5, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext: api Related to api folder module: models Related to doctr.models topic: text detection Related to the task of text detection type: enhancement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants