{"id":13542910,"url":"https://github.com/OCR-D/ocrd_segment","last_synced_at":"2025-04-02T12:30:51.878Z","repository":{"id":35587435,"uuid":"200879517","full_name":"OCR-D/ocrd_segment","owner":"OCR-D","description":"OCR-D-compliant page segmentation","archived":false,"fork":false,"pushed_at":"2024-09-05T13:46:40.000Z","size":2830,"stargazers_count":67,"open_issues_count":12,"forks_count":15,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-21T19:33:13.024Z","etag":null,"topics":["ocr-d"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCR-D.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-06T15:36:21.000Z","updated_at":"2024-11-14T10:06:30.000Z","dependencies_parsed_at":"2024-01-15T23:27:11.119Z","dependency_job_id":"a00ff3dd-1ba4-4e6f-a629-351022e093fc","html_url":"https://github.com/OCR-D/ocrd_segment","commit_stats":{"total_commits":209,"total_committers":11,"mean_commits":19.0,"dds":0.354066985645933,"last_synced_commit":"3c63e21b168b83bbb02caf4ce212db94447a5f4b"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCR-D%2Focrd_segment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCR-D%2Focrd_segment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCR-D%2Focrd_segment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCR-D%2Focrd_segment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCR-D","download_url":"https://codeload.github.com/OCR-D/ocrd_segment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246815307,"owners_count":20838420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ocr-d"],"created_at":"2024-08-01T11:00:19.657Z","updated_at":"2025-04-02T12:30:46.870Z","avatar_url":"https://github.com/OCR-D.png","language":"Python","funding_links":[],"categories":["Segmentation"],"sub_categories":["Document Segmentation"],"readme":"# ocrd_segment\n\nThis repository aims to provide a number of [OCR-D](https://ocr-d.de) [compliant](https://ocr-d.de/en/spec) [processors](https://ocr-d.de/en/spec/cli) for layout analysis and evaluation.\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/OCR-D/ocrd_segment/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/OCR-D/ocrd_segment/tree/master)\n[![image](https://img.shields.io/pypi/v/ocrd_segment.svg)](https://pypi.org/project/ocrd_segment/)\n[![Docker Automated build](https://img.shields.io/docker/automated/ocrd/segment.svg)](https://hub.docker.com/r/ocrd/segment/tags/)\n\n## Installation\n\nIn your [Python virtual environment](https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/), run:\n\n    pip install ocrd_segment\n\n## Usage\n\nContains processors for various tasks:\n\n- exporting segment images (including results from preprocessing like cropping/masking, deskewing, dewarping or binarization) along with polygon coordinates and metadata:\n  - [ocrd-segment-extract-pages](ocrd_segment/extract_pages.py) (for pages, also exports [MS-COCO](https://cocodataset.org/) format and pageview plots)\n  - [ocrd-segment-extract-regions](ocrd_segment/extract_regions.py) (for regions, so exports [MS-COCO](https://cocodataset.org/) format))\n  - [ocrd-segment-extract-lines](ocrd_segment/extract_lines.py) (for lines, also exports text and .xlsx)\n  - [ocrd-segment-extract-words](ocrd_segment/extract_words.py) (for words, also exports text)\n  - [ocrd-segment-extract-glyphs](ocrd_segment/extract_glyphs.py) (for glyphs, also exports text)\n- importing layout segmentations from other formats:\n  - [ocrd-segment-from-masks](ocrd_segment/import_image_segmentation.py) (for mask/label images, i.e. semantic segmentation)\n  - [ocrd-segment-from-coco](ocrd_segment/import_coco_segmentation.py) (for [MS-COCO](https://cocodataset.org/) annotation)\n- post-processing or repairing layout segmentations:\n  - [ocrd-segment-repair](ocrd_segment/repair.py) (validity and consistency of all coordinates; also, for regions, reduce overlaps/redundancy between neighbours, and/or simplify polygons, and/or shrink to the alpha shape of foreground contours)\n  - [ocrd-segment-project](ocrd_segment/project.py) (remake segment coordinates into the concave hull / alpha shape of their constituents)\n  - [ocrd-segment-replace-original](ocrd_segment/replace_original.py) (rebase all segments on cropped+deskewed border frame as new full page)\n  - [ocrd-segment-replace-page](ocrd_segment/replace_page.py) (2 input fileGrps; overwrite segmentation below page of first fileGrp by all segments of second fileGrp, rebasing all coordinates; \"inverse\" of `replace-original`)\n  - [ocrd-segment-replace-text](ocrd_segment/replace_text.py) (insert text below page from single-segment text files; \"inverse\" of `extract-*`)\n- comparing different layout segmentations:\n  - [ocrd-segment-evaluate](ocrd_segment/evaluate.py) :construction: (2 input fileGrps; align, compare and evaluate page segmentations; early stage)\n  - [page-segment-evaluate](ocrd_segment/evaluate.py) (same with standalone CLI)\n- pattern-based segmentation (input file groups N=1, based on a PAGE template, e.g. from Aletheia, and some XSLT or Python to apply it to the input file group)\n  - `ocrd-segment-via-template` :construction: (unpublished)\n- data-driven segmentation (input file groups N=1, based on a statistical model, e.g. Neural Network)  \n  - `ocrd-segment-via-model` :construction: (unpublished)\n\nFor detailed behaviour, see `--help` on each processor CLI.\nFor detailed description on input/output and parameters, see [ocrd-tool.json](ocrd_segment/ocrd-tool.json) or `--dump-json` on each processor CLI.\n\n## Development\n\n### Prerequisities\n\nRequires `libgeos-dev` library for building `shapely` binary requirement, see [Shapely Installation from source](https://shapely.readthedocs.io/en/stable/installation.html#installation-from-source-with-custom-geos-libary). Please ensure it's available before trying to install local requirements.\n\n## Testing\n\nNone yet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOCR-D%2Focrd_segment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOCR-D%2Focrd_segment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOCR-D%2Focrd_segment/lists"}