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

fix wrong output when --det=False #12589

Merged
merged 3 commits into from
Jun 5, 2024
Merged

Conversation

GreatV
Copy link
Collaborator

@GreatV GreatV commented Jun 3, 2024

before fix

paddleocr --image_dir 335849306-b6c1b619-2d1a-4932-be92-06c7bb8c044e.png --lang en --det False
[2024/06/03 09:26:41] ppocr INFO: ('(InvalidArgument) Broadcast dimension mismatch #12440', 0.9995993971824646)
Traceback (most recent call last):
  File "/Users/wangxin/miniconda3/envs/ppocr/bin/paddleocr", line 8, in <module>
    sys.exit(main())
  File "/Users/wangxin/repos/PaddleOCR/paddleocr.py", line 898, in main
    val += str(box[0]) + "," + str(box[1]) + ","
IndexError: string index out of range
paddleocr --image_dir 335849306-b6c1b619-2d1a-4932-be92-06c7bb8c044e.png  --det False 
[2024/06/03 09:26:48] ppocr INFO: ('(InvalidArgument) Broadcast dimension mismatch #12440', 0.9899256229400635)
Traceback (most recent call last):
  File "/Users/wangxin/miniconda3/envs/ppocr/bin/paddleocr", line 8, in <module>
    sys.exit(main())
  File "/Users/wangxin/repos/PaddleOCR/paddleocr.py", line 898, in main
    val += str(box[0]) + "," + str(box[1]) + ","
IndexError: string index out of range

after fix

paddleocr --image_dir 335849306-b6c1b619-2d1a-4932-be92-06c7bb8c044e.png  --det False --lang ch
[[('(InvalidArgument) Broadcast dimension mismatch #12440', 0.9899256229400635)]]
[2024/06/03 09:50:11] ppocr INFO: ('(InvalidArgument) Broadcast dimension mismatch #12440', 0.9899256229400635)
paddleocr --image_dir ./input/  --det False  --lang en --rec True --use_angle_cls True 
[2024/06/03 10:12:15] ppocr INFO: **********./input/333808456-01a58d72-74d9-439d-836b-2bb494f375fb.png**********
(1, 59, 97) None
[2024/06/03 10:12:15] ppocr INFO: ('6849sE0', 0.5022222399711609)
[2024/06/03 10:12:15] ppocr INFO: **********./input/334352202-c065007d-96b3-4a30-ab4d-42be47ec3ee8.png**********
(1, 40, 97) None
[2024/06/03 10:12:15] ppocr INFO: ('', 0.0)
[2024/06/03 10:12:15] ppocr INFO: **********./input/335849306-b6c1b619-2d1a-4932-be92-06c7bb8c044e.png**********
(1, 144, 97) None
[2024/06/03 10:12:15] ppocr INFO: ('(InvalidArgument) Broadcast dimension mismatch #12440', 0.9995993971824646)
[2024/06/03 10:12:15] ppocr INFO: **********./input/Image.png**********
(1, 40, 97) None
[2024/06/03 10:12:16] ppocr INFO: ('', 0.0)
[2024/06/03 10:12:16] ppocr INFO: **********./input/Image0.png**********
(1, 40, 97) None
[2024/06/03 10:12:16] ppocr INFO: ('', 0.0)
[2024/06/03 10:12:16] ppocr INFO: **********./input/Snipaste_2024-05-29_19-56-45.png**********
(1, 40, 97) None
[2024/06/03 10:12:16] ppocr INFO: ('E', 0.04727230221033096)
[2024/06/03 10:12:16] ppocr INFO: **********./input/result.png**********
(1, 40, 97) None
[2024/06/03 10:12:16] ppocr INFO: ('', 0.0)

paddleocr.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

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

LGTM

@jzhang533 jzhang533 merged commit b3954d3 into PaddlePaddle:main Jun 5, 2024
3 checks passed
@GreatV GreatV deleted the fix_det_False branch July 4, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants