hespi


Namehespi JSON
Version 0.4.4 PyPI version JSON
download
home_pagehttps://rbturnbull.github.io/hespi/
SummaryHErbarium Specimen sheet PIpeline
upload_time2024-04-19 01:17:07
maintainerNone
docs_urlNone
authorRobert Turnbull
requires_python<3.12,>=3.8
licenseApache-2.0
keywords herbarium object detection ocr htr specimen handwritten text recognition
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            ================================================================
hespi
================================================================

.. image:: https://raw.githubusercontent.com/rbturnbull/hespi/main/docs/images/hespi-banner.svg

.. start-badges

|testing badge| |coverage badge| |docs badge| |black badge|

.. |testing badge| image:: https://github.com/rbturnbull/hespi/actions/workflows/testing.yml/badge.svg
    :target: https://github.com/rbturnbull/hespi/actions

.. |docs badge| image:: https://github.com/rbturnbull/hespi/actions/workflows/docs.yml/badge.svg
    :target: https://rbturnbull.github.io/hespi
    
.. |black badge| image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black
    
.. |coverage badge| image:: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/rbturnbull/f31036b00473b6d0af3a160ea681903b/raw/coverage-badge.json
    :target: https://rbturnbull.github.io/hespi/coverage/
    
.. end-badges

HErbarium Specimen sheet PIpeline

.. start-quickstart

Hespi takes images of specimen sheets from herbaria and first detects the various components of the sheet. 


.. image:: https://raw.githubusercontent.com/rbturnbull/hespi/main/docs/images/HespiDiagram.jpg
    :alt: Hespi pipeline
    :align: center


Hespi first takes a specimen sheet and detects the various components of it using the Sheet-Component Model. 
Then any full database label detected is cropped and this is given to the Label-Field Model 
which detects different textual fields written on the label. 
A Label Classifier is also used to determine the type of text written on the label. 
If it is printed or typewritten, then the text of each field is given to an Optical Character Recognition (OCR) engine 
and if there is handwriting, then each field is given to the Handwritten Text Recognition (HTR) engine. 
Finally, the result of the fields is post-processed before being written into 
an HTML report, a CSV file and text files. 

The stages of the pipeline are explained in the `documentation for the pipeline <https://rbturnbull.github.io/hespi/pipeline.html>`_.


Installation
==================================

Install hespi using pip:

.. code-block:: bash

    pip install hespi

The first time it runs, it will download the required model weights from the internet.

It is recommended that you also install `Tesseract <https://tesseract-ocr.github.io/tessdoc/Home.html>`_ so that this can be used in the text recognition part of the pipeline.

To install the development version, see the `documentation for contributing <https://rbturnbull.github.io/hespi/contributing.html>`_.


Usage
==================================

To run the pipeline, use the executable ``hespi`` and give it any number of images:

.. code-block:: bash

    hespi image1.jpg image2.jpg

This will prompt you to specify an output directory. You can set the output directory with the command with the ``--output-dir`` argument:

.. code-block:: bash

    hespi images/*.tif --output-dir ./hespi-output

The detected components and text fields will be cropped and stored in the output directory. 
There will also be a CSV file with the filename ``hespi-results.csv`` in the output directory with the text recognition results for any institutional labels found.

More information on the command line arguments can be found in the `Command Line Reference <https://rbturnbull.github.io/hespi/cli.html>`_ in the documentation.

There is another command line utility called ``hespi-tools`` which provides additional functionality.
See the `documentation <https://rbturnbull.github.io/hespi/cli.html#hespi-tools>`_ for more information.

Training with custom data
==================================

To train the model with custom data, see the documention.

.. end-quickstart

Credits
==================================

.. start-credits

Robert Turnbull, Emily Fitzgerald, Karen Thompson and Jo Birch from the University of Melbourne.

This research was supported by The University of Melbourne’s Research Computing Services and the Petascale Campus Initiative. 
The authors thank collaborators Niels Klazenga, Heroen Verbruggen, Nunzio Knerr, Noel Faux, Simon Mutch, Babak Shaban, Andrew Drinnan, Michael Bayly and Hannah Turnbull.

Plant refererence data obtained from the `Australian National Species List (auNSL) <https://biodiversity.org.au/nsl>`_, as of March 2024, using the:

- Australian Plant Name Index (APNI)
- Australian Bryophyte Name Index (AusMoss)
- Australian Fungi Name Index (AFNI) 
- Australian Lichen Name Index (ALNI) 
- Australian Algae Name Index (AANI)



This pipeline depends on `YOLOv8 <https://github.com/ultralytics/ultralytics>`_, 
`torchapp <https://github.com/rbturnbull/torchapp>`_,
Microsoft's `TrOCR <https://www.microsoft.com/en-us/research/publication/trocr-transformer-based-optical-character-recognition-with-pre-trained-models/>`_.

Logo derived from artwork by `ka reemov <https://thenounproject.com/icon/plant-1386076/>`_.

.. end-credits

See the documentation for more information for references in BibTeX format or use the command:

.. code-block:: bash

    hespi-tools bibtex
            

Raw data

            {
    "_id": null,
    "home_page": "https://rbturnbull.github.io/hespi/",
    "name": "hespi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.8",
    "maintainer_email": null,
    "keywords": "herbarium, object detection, OCR, HTR, specimen, handwritten text recognition",
    "author": "Robert Turnbull",
    "author_email": "robert.turnbull@unimelb.edu.au",
    "download_url": "https://files.pythonhosted.org/packages/a9/c2/952f798e53f6a919bf4cf838964796638e24d37cb59678b6cb14a8842178/hespi-0.4.4.tar.gz",
    "platform": null,
    "description": "================================================================\nhespi\n================================================================\n\n.. image:: https://raw.githubusercontent.com/rbturnbull/hespi/main/docs/images/hespi-banner.svg\n\n.. start-badges\n\n|testing badge| |coverage badge| |docs badge| |black badge|\n\n.. |testing badge| image:: https://github.com/rbturnbull/hespi/actions/workflows/testing.yml/badge.svg\n    :target: https://github.com/rbturnbull/hespi/actions\n\n.. |docs badge| image:: https://github.com/rbturnbull/hespi/actions/workflows/docs.yml/badge.svg\n    :target: https://rbturnbull.github.io/hespi\n    \n.. |black badge| image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    \n.. |coverage badge| image:: https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/rbturnbull/f31036b00473b6d0af3a160ea681903b/raw/coverage-badge.json\n    :target: https://rbturnbull.github.io/hespi/coverage/\n    \n.. end-badges\n\nHErbarium Specimen sheet PIpeline\n\n.. start-quickstart\n\nHespi takes images of specimen sheets from herbaria and first detects the various components of the sheet. \n\n\n.. image:: https://raw.githubusercontent.com/rbturnbull/hespi/main/docs/images/HespiDiagram.jpg\n    :alt: Hespi pipeline\n    :align: center\n\n\nHespi first takes a specimen sheet and detects the various components of it using the Sheet-Component Model. \nThen any full database label detected is cropped and this is given to the Label-Field Model \nwhich detects different textual fields written on the label. \nA Label Classifier is also used to determine the type of text written on the label. \nIf it is printed or typewritten, then the text of each field is given to an Optical Character Recognition (OCR) engine \nand if there is handwriting, then each field is given to the Handwritten Text Recognition (HTR) engine. \nFinally, the result of the fields is post-processed before being written into \nan HTML report, a CSV file and text files. \n\nThe stages of the pipeline are explained in the `documentation for the pipeline <https://rbturnbull.github.io/hespi/pipeline.html>`_.\n\n\nInstallation\n==================================\n\nInstall hespi using pip:\n\n.. code-block:: bash\n\n    pip install hespi\n\nThe first time it runs, it will download the required model weights from the internet.\n\nIt is recommended that you also install `Tesseract <https://tesseract-ocr.github.io/tessdoc/Home.html>`_ so that this can be used in the text recognition part of the pipeline.\n\nTo install the development version, see the `documentation for contributing <https://rbturnbull.github.io/hespi/contributing.html>`_.\n\n\nUsage\n==================================\n\nTo run the pipeline, use the executable ``hespi`` and give it any number of images:\n\n.. code-block:: bash\n\n    hespi image1.jpg image2.jpg\n\nThis will prompt you to specify an output directory. You can set the output directory with the command with the ``--output-dir`` argument:\n\n.. code-block:: bash\n\n    hespi images/*.tif --output-dir ./hespi-output\n\nThe detected components and text fields will be cropped and stored in the output directory. \nThere will also be a CSV file with the filename ``hespi-results.csv`` in the output directory with the text recognition results for any institutional labels found.\n\nMore information on the command line arguments can be found in the `Command Line Reference <https://rbturnbull.github.io/hespi/cli.html>`_ in the documentation.\n\nThere is another command line utility called ``hespi-tools`` which provides additional functionality.\nSee the `documentation <https://rbturnbull.github.io/hespi/cli.html#hespi-tools>`_ for more information.\n\nTraining with custom data\n==================================\n\nTo train the model with custom data, see the documention.\n\n.. end-quickstart\n\nCredits\n==================================\n\n.. start-credits\n\nRobert Turnbull, Emily Fitzgerald, Karen Thompson and Jo Birch from the University of Melbourne.\n\nThis research was supported by The University of Melbourne\u2019s Research Computing Services and the Petascale Campus Initiative. \nThe authors thank collaborators Niels Klazenga, Heroen Verbruggen, Nunzio Knerr, Noel Faux, Simon Mutch, Babak Shaban, Andrew Drinnan, Michael Bayly and Hannah Turnbull.\n\nPlant refererence data obtained from the `Australian National Species List (auNSL) <https://biodiversity.org.au/nsl>`_, as of March 2024, using the:\n\n- Australian Plant Name Index (APNI)\n- Australian Bryophyte Name Index (AusMoss)\n- Australian Fungi Name Index (AFNI) \n- Australian Lichen Name Index (ALNI) \n- Australian Algae Name Index (AANI)\n\n\n\nThis pipeline depends on `YOLOv8 <https://github.com/ultralytics/ultralytics>`_, \n`torchapp <https://github.com/rbturnbull/torchapp>`_,\nMicrosoft's `TrOCR <https://www.microsoft.com/en-us/research/publication/trocr-transformer-based-optical-character-recognition-with-pre-trained-models/>`_.\n\nLogo derived from artwork by `ka reemov <https://thenounproject.com/icon/plant-1386076/>`_.\n\n.. end-credits\n\nSee the documentation for more information for references in BibTeX format or use the command:\n\n.. code-block:: bash\n\n    hespi-tools bibtex",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "HErbarium Specimen sheet PIpeline",
    "version": "0.4.4",
    "project_urls": {
        "Documentation": "https://rbturnbull.github.io/hespi/",
        "Homepage": "https://rbturnbull.github.io/hespi/",
        "Repository": "https://github.com/rbturnbull/hespi"
    },
    "split_keywords": [
        "herbarium",
        " object detection",
        " ocr",
        " htr",
        " specimen",
        " handwritten text recognition"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "01ad330b80ff35d4913460ae4d4fe58f8c9430bf3b7e3943401ffc647af30b16",
                "md5": "fe46b8b3b074de96b28e956750cf47c9",
                "sha256": "c7f2b382f80a748341cecc869a1456de028514c96f74e8b81e3cb070abbdc878"
            },
            "downloads": -1,
            "filename": "hespi-0.4.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe46b8b3b074de96b28e956750cf47c9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.8",
            "size": 570387,
            "upload_time": "2024-04-19T01:17:04",
            "upload_time_iso_8601": "2024-04-19T01:17:04.135472Z",
            "url": "https://files.pythonhosted.org/packages/01/ad/330b80ff35d4913460ae4d4fe58f8c9430bf3b7e3943401ffc647af30b16/hespi-0.4.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a9c2952f798e53f6a919bf4cf838964796638e24d37cb59678b6cb14a8842178",
                "md5": "a895fdb4247c29da09b5dc5ecc41108c",
                "sha256": "35e7eaebd31b11f1e2e5f9e0a32b40ce76a6f205211261333ddab279db74705c"
            },
            "downloads": -1,
            "filename": "hespi-0.4.4.tar.gz",
            "has_sig": false,
            "md5_digest": "a895fdb4247c29da09b5dc5ecc41108c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.8",
            "size": 567378,
            "upload_time": "2024-04-19T01:17:07",
            "upload_time_iso_8601": "2024-04-19T01:17:07.847653Z",
            "url": "https://files.pythonhosted.org/packages/a9/c2/952f798e53f6a919bf4cf838964796638e24d37cb59678b6cb14a8842178/hespi-0.4.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 01:17:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rbturnbull",
    "github_project": "hespi",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "hespi"
}
        
Elapsed time: 0.33994s