Reworking EasyOCR #839
Replies: 2 comments 23 replies
-
@JulianOrteil Thank you for summarizing the TODO list ! @rkcosmos You said that you were concerned about the stability of the package w.r.t PR we can make: maybe you can create a new development branch into which we will merge our PRs. You can then test intensively our changes before merging it into the master branch ? |
Beta Was this translation helpful? Give feedback.
-
这是来自QQ邮箱的假期自动回复邮件。您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
|
Beta Was this translation helpful? Give feedback.
-
This discussion relates to reworking EasyOCR and bringing it up to standards set by various PEPs and any suggested here.
The issue:
EasyOCR is a very popular library within the machine vision community. It competes with top-of-the-line software like Tesseract while maintaining a robust community. However its many achievements--which shouldn't be understated--the library falls short in multiple areas like documentation, testing, and readability; among others.
While perhaps not an issue for large swathes of users, these hindrances do present issues to others who want to contribute, fine-tune, or just learn OCR in general. Because of this, @ystoll and I have decided to donate our time to overhauling EasyOCR to address all of these issues while maintaining its excellent performance and ease of use for the typical user.
Breakdown:
Information about specific pain points we've identified is spread between two issues (#823 and #829); they'll be consolidated below. This is by no means an exhaustive list, so if you have a suggestion, please feel free to share it in a reply.
snake_case
, code comments being strings (not# comment
), unused variables, etc. All of these severely reduce the readability of EasyOCR and do present themselves as a hurdle for potential contributors.Reader.detect
. The library presents itself as "ready-to-go, out-of-the-box" and the current documentation may be sufficient for less-adept users. However, "power users" will spend considerable amounts of time tweaking parameters to find the optimal outcome for their problems and should be able to discern what they do from reading the docstrings. Not to mention, the documentation hosted on JaidedAI's website is separate from the code. Using ReadTheDocs, documentation can be updated with code commits automatically, reducing overhead.Approach:
@rkcosmos stated in #823 that he is concerned about one massive PR being used for a project like this. This is a valid point. To appease this concern, the best approach will likely be making changes, with compatibility, over multiple versions. This allows for a more seamless change in the code base--keeping the old API for a couple of versions with deprecation warnings alongside the new API--but does introduce much compatibility work on top of the proposed changes.
Plan:
For this rework to take place, a game plan should be determined before any work is performed. As such, I propose the following:
tox
and/or GitHub Actions and is the least invasive change. Because it doesn't affect the main source code, this change will be invisible to end-users. This also sets up workflows for further steps.DeprecationWarning
s everywhere in the old code telling users to start using the new API while maintaining the old API as-is. Our changes should be invisible to the end user unless they absolutely cannot be avoided.Step 7 should be the extent of this rework. Obviously, as we work through these changes, there may be areas where we can improve or optimize code, but that should be left for another day. The entire purpose of this rework should be limited to just addressing the above points and any points discussed below.
If you have any ideas, concerns, questions, or other comments related to this rework you feel would be beneficial to add, then please post them. We are also open to adding additional contributors to this project if you feel the desire to.
Beta Was this translation helpful? Give feedback.
All reactions