{"id":17149814,"url":"https://github.com/keeferrourke/imgrep","last_synced_at":"2025-04-13T11:51:44.886Z","repository":{"id":57572110,"uuid":"103771477","full_name":"keeferrourke/imgrep","owner":"keeferrourke","description":"A grep for images. Submission to Hack the North 2017.","archived":false,"fork":false,"pushed_at":"2017-11-20T21:59:33.000Z","size":1998,"stargazers_count":24,"open_issues_count":6,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T03:02:46.165Z","etag":null,"topics":["cli","golang","grep","grepping","hackathon","hackthenorth","htn17","image-processing","images","imgrep","tesseract","waterloo"],"latest_commit_sha":null,"homepage":"https://devpost.com/software/imgrep","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keeferrourke.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}},"created_at":"2017-09-16T17:39:57.000Z","updated_at":"2025-03-22T17:19:51.000Z","dependencies_parsed_at":"2022-08-24T03:11:16.477Z","dependency_job_id":null,"html_url":"https://github.com/keeferrourke/imgrep","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keeferrourke%2Fimgrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keeferrourke%2Fimgrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keeferrourke%2Fimgrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keeferrourke%2Fimgrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keeferrourke","download_url":"https://codeload.github.com/keeferrourke/imgrep/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710438,"owners_count":21149188,"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":["cli","golang","grep","grepping","hackathon","hackthenorth","htn17","image-processing","images","imgrep","tesseract","waterloo"],"created_at":"2024-10-14T21:34:10.468Z","updated_at":"2025-04-13T11:51:44.865Z","avatar_url":"https://github.com/keeferrourke.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# imgrep\n\n`imgrep` is a command-line utility in Go to search for keywords found\nwithin images.\n\n![coverage](https://img.shields.io/badge/coverage-67%25-orange.svg)\n[![goreport](https://goreportcard.com/badge/github.com/keeferrourke/imgrep)](https://goreportcard.com/report/github.com/keeferrourke/imgrep)\n\n## Installation\n\n`imgrep` depends on\n[Tesseract](https://github.com/tesseract-ocr/tesseract).\n\n  * On Fedora: `sudo dnf install tesseract-devel`\n  * On Debian: `sudo apt-get install libtesseract-dev`\n  * On macOS: `brew install tesseract`\n\n### Prerequisites\n#### Linux: \n\n```\n# Fedora\nsudo dnf install tesseract tesseract-devel leptonica-devel golang\n\n# Debian\nsudo apt-get install tesseract-ocr libtesseract-dev libleptonica-dev golang\n```\n\n#### macOS:\n\n 1. Install [Go](https://golang.org/dl/)\n 2. Install [homebrew](https://brew.sh)\n\n```\nbrew install tesseract\n```\n\n### Get `imgrep`\nMake sure your `$GOPATH` is set, then run:\n\n```\n# fetch src and install binary\ngo get -u github.com/keeferrourke/imgrep\ngo install github.com/keeferrourke/imgrep\n```\n\n## Usage\n\n`imgrep` like `grep`, searches file contents for text. `imgrep` works\nexclusively on images however, using text extracted using OCR as the\nsearch haystack.\n\n`imgrep` comes with two interfaces; a CLI as one might expect, and a\nweb-UI graphical front-end.\n\n### CLI\n\nBecause OCR is expensive to the CPU, `imgrep` can pre-process and\nindex files by keywords stored to a database. This database is queried\nunless specified otherwise. To preindex an entire\ndirectory (including subdirectories):\n\n```\nimgrep init # pre-process and index image files in working directory\n```\n\nBy default, `imgrep` uses this database of pre-indexed files to perform\nsimple queries. Because of the nature of OCR, picked up keywords may not\nbe accurate, so a sort of \"fuzzy-search\" is employed here. To mimic the\noriginal usage of `grep`, `imgrep` queries are case-sensitive. The `-i`\noption is provided to ignore case specifiers of query strings \u0026mdash;\nit is nearly always recommended to run your queries with this option.\n\nTo check preindexed directories:\n\n```\nimgrep search -i QUERY\n```\n\nTo use `imgrep` without checking against the database of preindexed\nfiles, simply call\n\n```\nimgrep search -n -i QUERY\n```\n\nLike the `grep` family of functions, `imgrep` is useful with Unix-pipes:\n\n```\n# Example: Count the number of images that contain the first line of a\n#          plain-text file\nhead -n1 myfile | imgrep search -n -i - | wc -l\n\n# Example: Open the first file that matches a search\nxdg-open \"$(imgrep s learn | head -n1)\"\n```\n\n## Web UI\nSee [`imgrep-web`](https://github.com/keeferrourke/imgrep-web).\n\n## License\n`imgrep` is free software licensed under the MIT license.\n\nCopyright (c) 2017 Keefer Rourke and Ivan Zhang.\n\nSee LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeeferrourke%2Fimgrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeeferrourke%2Fimgrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeeferrourke%2Fimgrep/lists"}