{"id":15664353,"url":"https://github.com/robmarkcole/hass-amazon-rekognition-text","last_synced_at":"2025-05-06T19:20:35.742Z","repository":{"id":53521760,"uuid":"346958088","full_name":"robmarkcole/HASS-amazon-rekognition-text","owner":"robmarkcole","description":"Home Assistant integration to extract text from digital and mechanical displays using AWS rekognition","archived":false,"fork":false,"pushed_at":"2021-03-26T08:29:08.000Z","size":5230,"stargazers_count":16,"open_issues_count":7,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-24T20:01:49.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robmarkcole.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":"2021-03-12T06:00:24.000Z","updated_at":"2023-12-02T09:14:40.000Z","dependencies_parsed_at":"2022-09-02T02:02:20.334Z","dependency_job_id":null,"html_url":"https://github.com/robmarkcole/HASS-amazon-rekognition-text","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-amazon-rekognition-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-amazon-rekognition-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-amazon-rekognition-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-amazon-rekognition-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robmarkcole","download_url":"https://codeload.github.com/robmarkcole/HASS-amazon-rekognition-text/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231420730,"owners_count":18374106,"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":[],"created_at":"2024-10-03T13:42:16.046Z","updated_at":"2024-12-28T03:51:26.330Z","avatar_url":"https://github.com/robmarkcole.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HASS-amazon-rekognition-text\nHome Assistant integration to extract text from digital and mechanical displays using AWS rekognition computer vision service.\n\nThis integration adds an entity where the state of the entity is the detected text in the camera image. A region of interest (`roi`) should be used to select the region of the image containing the text you wish to read. Optionally various processing can be performed to help improve detection. You should experiment with these options if you are experiencing errors in the detected text. The processing options are:\n\n- `make_bw` will convert images to black and white before processing\n- `erode` can be used for pixelated LCD screens, to erode discrete pixels into single characters, start with `low`\n\n## Configuration in Home Assistant\nPlace the `custom_components` folder in your configuration directory (or add its contents to an existing `custom_components` folder). Then configure the integration.\n\nExample config:\n```yaml\nimage_processing:\n  - platform: amazon_rekognition_text\n    aws_access_key_id: yours\n    aws_secret_access_key: yours\n    region_name: eu-west-1 # optional region, default is us-east-1\n    roi_x_min: 0.35\n    roi_x_max: 0.83\n    roi_y_min: 0.7\n    roi_y_max: 0.9\n    save_file_folder: /config/rekognition/\n    save_timestamped_file: True\n    unit_of_measurement: £\n    source:\n      - entity_id: camera.local_file\n```\n\nConfiguration variables:\n- **aws_access_key_id**: Your AWS key ID\n- **aws_secret_access_key**: Your AWS key secret\n- **region_name**: Your preferred AWS region\n- **roi_x_min**: (optional, default 0), range 0-1, must be less than roi_x_max\n- **roi_x_max**: (optional, default 1), range 0-1, must be more than roi_x_min\n- **roi_y_min**: (optional, default 0), range 0-1, must be less than roi_y_max\n- **roi_y_max**: (optional, default 1), range 0-1, must be more than roi_y_min\n- **numbers_only**: (optional, default False), if `True`, attempts to return only the numbers detected\n- **make_bw**: (optional, default False), if `True`, converts image to black and white before processing\n- **erode**: (optional, default None, values are `low`, `medium`, `high`), useful for merging black pixels\n- **save_file_folder**: (Optional) The folder to save processed images to. Note that folder path should be added to [whitelist_external_dirs](https://www.home-assistant.io/docs/configuration/basic/)\n- **save_timestamped_file**: (Optional, default `False`, requires `save_file_folder` to be configured) Save the processed image with the time of detection in the filename.\n- **unit_of_measurement**: (Optional) the units to add, required if you want a graph for numbers\n- **source**: Must be a camera.\n\nFor the `roi`, the (x=0,y=0) position is the top left pixel of the image, and the (x=1,y=1) position is the bottom right pixel of the image. It might seem a bit odd to have y running from top to bottom of the image, but that is the coordinate system used by pillow. A streamlit app is provided to help with configuration of the ROI values, documented at the end of this readme. **Note** that to view the configured `roi` you must configure the `save_file_folder` and view the latest saved image, which can be displayed on the HA UI with a [local_file camera](https://www.home-assistant.io/integrations/local_file/)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/robmarkcole/HASS-amazon-rekognition-text/blob/main/docs/usage.png\" width=\"500\"\u003e\n\u003c/p\u003e\n\n## local_file camera example\nExample config for displaying the latest saved image:\n```yaml\ncamera:\n  - platform: local_file\n    name: rekognition_text\n    file_path: /config/rekognition/rekognition_text_local_file_1_latest.png\n```\n\n## Streamlit app\nA streamlit app is available to help with config. To use a hosted version go to:\n- [https://share.streamlit.io/robmarkcole/hass-amazon-rekognition-text/main](https://share.streamlit.io/robmarkcole/hass-amazon-rekognition-text/main)\n\nOr run locally following the instructions below:\n* Create a venv: `python3 -m venv venv`\n* Activate venv: `source venv/bin/activate`\n* Install requirements: `pip3 install -r requirements-app.txt`\n* Run streamlit app: `streamlit run streamlit_app.py`\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/robmarkcole/HASS-amazon-rekognition-text/blob/main/docs/streamlit_app.png\" width=\"900\"\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobmarkcole%2Fhass-amazon-rekognition-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobmarkcole%2Fhass-amazon-rekognition-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobmarkcole%2Fhass-amazon-rekognition-text/lists"}