django-ocr_translate


Namedjango-ocr_translate JSON
Version 0.6.0 PyPI version JSON
download
home_pageNone
SummaryDjango app for OCR and translation
upload_time2024-08-19 21:46:45
maintainerNone
docs_urlNone
authorDavide Grassano
requires_python>=3.10
licenseNone
keywords django ocr translation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <p align="center">
	<a href="https://pypi.org/project/django-ocr_translate/"><img src="https://img.shields.io/pypi/dm/django-ocr_translate?style=flat-square" alt="pypi"/></a>
	<a href="https://pypi.org/project/django-ocr_translate/"><img src="https://img.shields.io/pypi/v/django-ocr_translate?style=flat-square" /></a>
	<a href="https://pypi.org/project/django-ocr_translate/"><img src="https://img.shields.io/github/downloads/Crivella/ocr_translate/total.svg?style=flat-square" /></a>
  <br />
	<a href="https://crivella.github.io/ocr_translate/"><img src="https://img.shields.io/badge/GitHub%20Pages-222222?style=for-the-badge&logo=GitHub%20Pages&logoColor=white" alt="pypi"/></a>
  </p>
</div>

# OCR_translate

This is a Django app for creating back-end server aimed at performing OCR and translation of images received via a POST request.

The OCR and translation is performed using freely available machine learning models and packages (see below for what is currently implemented).

The server is designed to be used together with [this browser extension](https://github.com/Crivella/ocr_extension), acting as a front-end providing the images and controlling the languages, models and plugins being used.

For more information, please consult the **[Full Documentation](https://crivella.github.io/ocr_translate/)**

## Running the server

See the [documentation](https://crivella.github.io/ocr_translate/user/index.html#running-the-server) for more information.

**TLDR:** If you are on windows you will need to:

- install [python](https://www.python.org/downloads/windows/) with the check on `Add python.exe to PATH`
- download>unzip the [release file](/../../releases/latest/download/run_server.zip)
- run the `run-user.bat` file

### Why do I need to install python

Before version `v0.6.0` the server was distributed by including all possible plugins and their dependencies.\
This made the distribution file (both the github release and docker image) quite large and the release process cumbersome.\
Furthermore, not every user might be interested in every plugin and might end up downloading GB of files that they will never use.

For this reason a [plugin_manager](ocr_translate/plugin_manager.py) has been added to the project that will download/install the plugins and their dependencies on demand.\
Installing python packages requires `pip` to be available (which is included with python on the windows installer).\
Unfortunately I have not found a way to include pip reliably in the frozen install produced for the release file.\
The alternative would've been to add a 2nd installer just to get `pip` before running the server, but why reinvent the wheel.

The check on `Add python.exe to PATH` is needed so that `pip` can be run without having to make any assumption on the installation path.

Also since I am now asking people to install python, I decided to go all the way and use an approach similar to what [automatic1111's webui.bat](https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/webui.bat) does for stable diffusion.\
This batch script will create/reuse a virtual environment in a folder `venv` in the same directory as the script and install the required packages in it.

## Contributing

- Suggestions/Ideas are always welcome and can be posted as [discussions](https://github.com/Crivella/ocr_translate/discussions).\
  You can also just propose a new model to be tested/added to the ones available by default.
- Bugs can be reported as [issues](https://github.com/Crivella/ocr_translate/issues)
- Code contributions as [pull requests](https://github.com/Crivella/ocr_translate/pulls).
  Check [the documentation](https://crivella.github.io/ocr_translate/contrib/index.html) for more information.

## Plugins

The server is designed to only offer the basic functionalities, while the models that can be used and how they are used are defined by plugins.

See the documentation for a [list of available plugins](https://crivella.github.io/ocr_translate/plugins/index.html)

### Notes

- When switching the server between CPU/CUDA mode for the first time, run the installation of the plugins again to make sure the scope-specific dependencies are installed.

## Possible problems

- [Issue 25](/../../issues/25) Using uBlock origin (or possibly other extension capable of blocking content) could stop the extension from sending requests to the server. This can be recognized if the popup for setting the language and models works fine but than the translations fails without producing any new log in the server windows. (WIP long term fix in the extension)

- [Issue 27](/../../issues/27) Having non latin characters in the model's path can cause HuggingFace `transformers` to fail loading them

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-ocr_translate",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "django, ocr, translation",
    "author": "Davide Grassano",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/16/b8/5a9b86c4a4e7d7b49273d513454850037358763b2580352e9b42b1483775/django_ocr_translate-0.6.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <p align=\"center\">\n\t<a href=\"https://pypi.org/project/django-ocr_translate/\"><img src=\"https://img.shields.io/pypi/dm/django-ocr_translate?style=flat-square\" alt=\"pypi\"/></a>\n\t<a href=\"https://pypi.org/project/django-ocr_translate/\"><img src=\"https://img.shields.io/pypi/v/django-ocr_translate?style=flat-square\" /></a>\n\t<a href=\"https://pypi.org/project/django-ocr_translate/\"><img src=\"https://img.shields.io/github/downloads/Crivella/ocr_translate/total.svg?style=flat-square\" /></a>\n  <br />\n\t<a href=\"https://crivella.github.io/ocr_translate/\"><img src=\"https://img.shields.io/badge/GitHub%20Pages-222222?style=for-the-badge&logo=GitHub%20Pages&logoColor=white\" alt=\"pypi\"/></a>\n  </p>\n</div>\n\n# OCR_translate\n\nThis is a Django app for creating back-end server aimed at performing OCR and translation of images received via a POST request.\n\nThe OCR and translation is performed using freely available machine learning models and packages (see below for what is currently implemented).\n\nThe server is designed to be used together with [this browser extension](https://github.com/Crivella/ocr_extension), acting as a front-end providing the images and controlling the languages, models and plugins being used.\n\nFor more information, please consult the **[Full Documentation](https://crivella.github.io/ocr_translate/)**\n\n## Running the server\n\nSee the [documentation](https://crivella.github.io/ocr_translate/user/index.html#running-the-server) for more information.\n\n**TLDR:** If you are on windows you will need to:\n\n- install [python](https://www.python.org/downloads/windows/) with the check on `Add python.exe to PATH`\n- download>unzip the [release file](/../../releases/latest/download/run_server.zip)\n- run the `run-user.bat` file\n\n### Why do I need to install python\n\nBefore version `v0.6.0` the server was distributed by including all possible plugins and their dependencies.\\\nThis made the distribution file (both the github release and docker image) quite large and the release process cumbersome.\\\nFurthermore, not every user might be interested in every plugin and might end up downloading GB of files that they will never use.\n\nFor this reason a [plugin_manager](ocr_translate/plugin_manager.py) has been added to the project that will download/install the plugins and their dependencies on demand.\\\nInstalling python packages requires `pip` to be available (which is included with python on the windows installer).\\\nUnfortunately I have not found a way to include pip reliably in the frozen install produced for the release file.\\\nThe alternative would've been to add a 2nd installer just to get `pip` before running the server, but why reinvent the wheel.\n\nThe check on `Add python.exe to PATH` is needed so that `pip` can be run without having to make any assumption on the installation path.\n\nAlso since I am now asking people to install python, I decided to go all the way and use an approach similar to what [automatic1111's webui.bat](https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/webui.bat) does for stable diffusion.\\\nThis batch script will create/reuse a virtual environment in a folder `venv` in the same directory as the script and install the required packages in it.\n\n## Contributing\n\n- Suggestions/Ideas are always welcome and can be posted as [discussions](https://github.com/Crivella/ocr_translate/discussions).\\\n  You can also just propose a new model to be tested/added to the ones available by default.\n- Bugs can be reported as [issues](https://github.com/Crivella/ocr_translate/issues)\n- Code contributions as [pull requests](https://github.com/Crivella/ocr_translate/pulls).\n  Check [the documentation](https://crivella.github.io/ocr_translate/contrib/index.html) for more information.\n\n## Plugins\n\nThe server is designed to only offer the basic functionalities, while the models that can be used and how they are used are defined by plugins.\n\nSee the documentation for a [list of available plugins](https://crivella.github.io/ocr_translate/plugins/index.html)\n\n### Notes\n\n- When switching the server between CPU/CUDA mode for the first time, run the installation of the plugins again to make sure the scope-specific dependencies are installed.\n\n## Possible problems\n\n- [Issue 25](/../../issues/25) Using uBlock origin (or possibly other extension capable of blocking content) could stop the extension from sending requests to the server. This can be recognized if the popup for setting the language and models works fine but than the translations fails without producing any new log in the server windows. (WIP long term fix in the extension)\n\n- [Issue 27](/../../issues/27) Having non latin characters in the model's path can cause HuggingFace `transformers` to fail loading them\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Django app for OCR and translation",
    "version": "0.6.0",
    "project_urls": {
        "Source": "https://github.com/crivella/ocr_translate"
    },
    "split_keywords": [
        "django",
        " ocr",
        " translation"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "421091c9e97982f6c837cd521997f1c282ef303c93e654abdad789958f9f637a",
                "md5": "f49f12ce8dfabd27ca409f9b902bc26a",
                "sha256": "6f9c695eefcd7801e407592de6254a9cf2e072ca96be5dcb84e809f79a69fbba"
            },
            "downloads": -1,
            "filename": "django_ocr_translate-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f49f12ce8dfabd27ca409f9b902bc26a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 1219826,
            "upload_time": "2024-08-19T21:46:43",
            "upload_time_iso_8601": "2024-08-19T21:46:43.241368Z",
            "url": "https://files.pythonhosted.org/packages/42/10/91c9e97982f6c837cd521997f1c282ef303c93e654abdad789958f9f637a/django_ocr_translate-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "16b85a9b86c4a4e7d7b49273d513454850037358763b2580352e9b42b1483775",
                "md5": "0cd9bab61d8126218be6829aa52fe896",
                "sha256": "c7184b86e44f79ffce107f33879dcd65800356edeab2a77b54fbb39e92243bd5"
            },
            "downloads": -1,
            "filename": "django_ocr_translate-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0cd9bab61d8126218be6829aa52fe896",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 1209132,
            "upload_time": "2024-08-19T21:46:45",
            "upload_time_iso_8601": "2024-08-19T21:46:45.243337Z",
            "url": "https://files.pythonhosted.org/packages/16/b8/5a9b86c4a4e7d7b49273d513454850037358763b2580352e9b42b1483775/django_ocr_translate-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-19 21:46:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "crivella",
    "github_project": "ocr_translate",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "django-ocr_translate"
}
        
Elapsed time: 0.25761s