-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP - migrating from hardcoded model loading/usage to plugins * Abstracted logic for `OCRBoxModel`s * Reimplemented proper usage of ENV variables in the premade plugins. * Added entrypoints to JSON of validated models. * WIP - remaking tests to reflect changes * Fixed tests for 100% coverage * Updated README with info on writing plugins * Bump version number * Added changelog file * pylint * Fix needed to carry entrypoints with pyinstaller
- Loading branch information
Showing
46 changed files
with
2,478 additions
and
1,871 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Change Log | ||
|
||
List of changes between versions | ||
|
||
## 0.2.0 | ||
|
||
Restructured the code to make it pluginable. | ||
No change should be noticeable from a user experience point of view, but now it should be much easier to contribute to the code (new functionalities can be introduced by writing a plugin without having to modify this codebase). | ||
|
||
- The models entries in the database now requires an `entrypoint` field to identify which model should be used to load it. | ||
- The functionality related to `easyocr`, `tesseract` and `hugginface` models have been moved to the `ocr_translate/plugins` folder, and are now plugins (kept in the main codebase to leave an example on how a plugin can work). | ||
|
||
## 0.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.4 on 2023-08-03 13:30 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('ocr_translate', '0002_ocrboxmodel_default_options_ocrmodel_default_options_and_more_squashed_0005_alter_ocrboxmodel_default_options_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='tslmodel', | ||
name='entrypoint', | ||
field=models.CharField(max_length=128, null=True), | ||
), | ||
] |
29 changes: 29 additions & 0 deletions
29
ocr_translate/migrations/0007_ocrmodel_entrypoint_alter_ocrmodel_default_options_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 4.2.4 on 2023-08-03 14:48 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('ocr_translate', '0006_tslmodel_entrypoint'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='ocrmodel', | ||
name='entrypoint', | ||
field=models.CharField(max_length=128, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='ocrmodel', | ||
name='default_options', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='used_by_%(class)s', to='ocr_translate.optiondict'), | ||
), | ||
migrations.AlterField( | ||
model_name='tslmodel', | ||
name='default_options', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='used_by_%(class)s', to='ocr_translate.optiondict'), | ||
), | ||
] |
24 changes: 24 additions & 0 deletions
24
ocr_translate/migrations/0008_ocrboxmodel_entrypoint_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 4.2.4 on 2023-08-03 16:27 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('ocr_translate', '0007_ocrmodel_entrypoint_alter_ocrmodel_default_options_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='ocrboxmodel', | ||
name='entrypoint', | ||
field=models.CharField(max_length=128, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='ocrboxmodel', | ||
name='default_options', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='used_by_%(class)s', to='ocr_translate.optiondict'), | ||
), | ||
] |
Oops, something went wrong.