{"id":50476278,"url":"https://github.com/haschka/ocr_tool","last_synced_at":"2026-06-01T13:31:16.253Z","repository":{"id":349197820,"uuid":"1201398869","full_name":"haschka/ocr_tool","owner":"haschka","description":"A tool to perform OCR with an AI OCR model and an inference engine like llama.cpp","archived":false,"fork":false,"pushed_at":"2026-04-13T09:14:52.000Z","size":1196,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T11:19:22.839Z","etag":null,"topics":["ai","ai-tools","graphical-interface","ocr","optical-character-recognition","sdl2"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haschka.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-04T16:16:36.000Z","updated_at":"2026-04-13T09:14:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/haschka/ocr_tool","commit_stats":null,"previous_names":["haschka/ocr_tool"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/haschka/ocr_tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haschka%2Focr_tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haschka%2Focr_tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haschka%2Focr_tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haschka%2Focr_tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haschka","download_url":"https://codeload.github.com/haschka/ocr_tool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haschka%2Focr_tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33777967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","ai-tools","graphical-interface","ocr","optical-character-recognition","sdl2"],"created_at":"2026-06-01T13:31:15.372Z","updated_at":"2026-06-01T13:31:16.247Z","avatar_url":"https://github.com/haschka.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ocr_tool\nA tool to perform OCR with an AI OCR model and an inference engine like llama.cpp.\n\n## Installation:\n\nThe tool is dependent on glib-2.0, libpng, json-c, SDL2, and a\npthreads implemenation. Please install a typical c-compilier, \nand build tool-chain according to your distribution. \nI.e. build-essentials and the dev packages of the \ndependent libraries.\n\nSuccessful compilation can in general be achieved like:\n```\ngcc -O2 -march=native ocr_tool.c local_resolve.c `sdl2-config --libs` \\\n`pkgconf --libs --cflags glib-2.0` -lcurl -lpng -ljson-c -pthread \\\n-o ocr_tool\n```\n\nGentoo Users may enjoy the ebuild in this repository. \n\n## General Usage:\nThe tool requires an inference provider with OCR\ncapabilities. Currently the tool does not connect to SSL enabled\nservers, nor does it accept api keys in the current version. Inference \nfor OCR use cases can easily be run on the local machine on the CPU\nwith reasonable good models. The tool was mainly tested with \n*Deepseek-OCR* though other models may work. A suggested workflow is:\n\n1. Download Deepseek-OCR, i.e. from huggingface:\n   https://huggingface.co/ggml-org/DeepSeek-OCR-GGUF/tree/main\n   You need both `DeepSeek-OCR-Q8_0.gguf` and\n   `mmproj-DeepSeek-OCR-Q8_0.gguf`\n\n2. Install llama.cpp:\n   https://github.com/ggml-org/llama.cpp\n   i.e. from the website or from your distribution.\n   \n3. Run the llama.cpp with the OCR model:\n   ```\n   llama-server -m DeepSeek-OCR-Q8_0.gguf \\\n   --mmproj mmproj-DeepSeek-OCR-Q8_0.gguf \\\n   --hostname localhost --port 8080\n   ```\n   \n4. Run the tool and select a text region:\n   ```\n   ./ocr-tool test.png localhost 8080\n   ```\n   Detected text is automatically written to stdout\n   \n5. Quit the tool by hitting the ESCAPE key. \n\n## Keybindings and Mouse Usage:\n\n- `q`-key kills the current request to the inference provider\n  (i.e. llama.cpp). Some models will take a long time to respond,\n  i.e. if the selected area contains no text. This key allows you to\n  cancel a request.\n  \n- `ESC`-key quits the program.\n\n- `1` Standard zoom level.\n\n- `2` 2x zoom.\n\n- `3` 3x zoom.\n\n- `Left Mouse` Drag a red selection rectangle that contains the text to be OCR'd.\n\n- `Middle Mouse` Pan accross the document, and switch to selected zoom level. \n\n## Trivia:\nThe provided test image `test.png` is taken from:\n\nCours d'analyse de l'École royale polytechnique\n\nby Cauchy published in 1821.\n\n## Screenshot:\n\n![](screenshot.png)\n\n  \n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaschka%2Focr_tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaschka%2Focr_tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaschka%2Focr_tool/lists"}