{"id":15707361,"url":"https://github.com/robmarkcole/hass-machinebox-tagbox","last_synced_at":"2025-05-12T21:09:16.230Z","repository":{"id":49488264,"uuid":"127709063","full_name":"robmarkcole/HASS-Machinebox-Tagbox","owner":"robmarkcole","description":"Home-Assistant custom integration for image tag detection using Tagbox","archived":false,"fork":false,"pushed_at":"2021-06-16T17:09:11.000Z","size":11396,"stargazers_count":5,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-12T21:09:08.935Z","etag":null,"topics":["camera","detection","hass-machinebox-tagbox","home-assistant","image-classification","machinebox","tagbox"],"latest_commit_sha":null,"homepage":"https://machinebox.io/docs/tagbox/recognizing-images","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/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":"2018-04-02T05:57:09.000Z","updated_at":"2023-05-08T22:05:02.000Z","dependencies_parsed_at":"2022-08-24T18:14:05.480Z","dependency_job_id":null,"html_url":"https://github.com/robmarkcole/HASS-Machinebox-Tagbox","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Tagbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Tagbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Tagbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Tagbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robmarkcole","download_url":"https://codeload.github.com/robmarkcole/HASS-Machinebox-Tagbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253823442,"owners_count":21969847,"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":["camera","detection","hass-machinebox-tagbox","home-assistant","image-classification","machinebox","tagbox"],"created_at":"2024-10-03T20:40:22.838Z","updated_at":"2025-05-12T21:09:16.191Z","avatar_url":"https://github.com/robmarkcole.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Home-Assistant custom component for image classification (`tag` detection) using Machinebox.io [Tagbox](https://machinebox.io/docs/tagbox/recognizing-images). The component adds an `image_processing` entity, where the state of the entity is the most likely tag in the image above a given confidence threshold. The attribute `tags` contains all data returned by the API, whilst the attribute `matched_tags` contains only tags matched with a confidence greater than a `confidence` threshold (in %). The event `tagbox.detect_tag` is fired for each tag above the confidence threshold, and the event data contains the fields `name` of tag, `confidence` of detection, and the `entity_id` that fired the event.\n\nPlace the `custom_components` folder in your configuration directory (or add its contents to an existing custom_components folder).\n\nAdd to your HA config:\n```yaml\nimage_processing:\n  - platform: tagbox\n    ip_address: localhost\n    port: 8080\n    confidence: 50\n    source:\n      - entity_id: camera.local_file\n```\n\nConfiguration variables:\n- **ip_address**: the ip of your Tagbox instance\n- **port**: the port of your Tagbox instance\n- **confidence**: (Optional, default 80) The threshold in % above which tags appear in `matched_tags` and `tagbox.detect_tag` events are fired.\n- **source**: must be a camera.\n\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/robmarkcole/HASS-Machinebox-Tagbox/blob/master/tagbox_usage.png\" width=\"650\"\u003e\n\u003c/p\u003e\n\n### Tagbox\nGet/update Tagbox [from Dockerhub](https://hub.docker.com/r/machinebox/tagbox/) by running:\n```\ndocker pull machinebox/tagbox\n```\n\n[Run Tagbox with](https://machinebox.io/docs/tagbox/recognizing-images):\n```\nMB_KEY=\"INSERT-YOUR-KEY-HERE\"\ndocker run -p 8080:8080 -e \"MB_KEY=$MB_KEY\" machinebox/tagbox\n```\nTo limit tagbox to only custom tags, add to the command `-e MB_TAGBOX_ONLY_CUSTOM_TAGS=true`. Tagbox will be then only return and calculate custom tags, saving some compute resources.\n```\ndocker run -p 8080:8080 -e \"MB_KEY=$MB_KEY\" -e MB_TAGBOX_ONLY_CUSTOM_TAGS=true machinebox/tagbox\n```\nYou should see a message on startup `pretrained tags are disabled, only custom tags will be returned`.\n\n### Default tags\nTagbox is trained on https://storage.googleapis.com/openimages/web/index.html with the default tags listed in `tagbox_classes.csv`\n\n### Teaching tagbox\nI've written a script to allow teaching tagbox from folders of images, the script is at https://github.com/robmarkcole/tagbox_python\n\n#### Limiting computation\n[Image-classifier components](https://www.home-assistant.io/components/image_processing/) process the image from a camera at a fixed period given by the `scan_interval`. This leads to excessive computation if the image on the camera hasn't changed (for example if you are using a [local file camera](https://www.home-assistant.io/components/camera.local_file/) to display an image captured by a motion triggered system and this doesn't change often). The default `scan_interval` [is 10 seconds](https://github.com/home-assistant/home-assistant/blob/98e4d514a5130b747112cc0788fc2ef1d8e687c9/homeassistant/components/image_processing/__init__.py#L27). You can override this by adding to your config `scan_interval: 10000` (setting the interval to 10,000 seconds), and then call the `scan` [service](https://github.com/home-assistant/home-assistant/blob/98e4d514a5130b747112cc0788fc2ef1d8e687c9/homeassistant/components/image_processing/__init__.py#L62) when you actually want to process a camera image. So in my setup, I use an automation to call `scan` when a new motion triggered image has been saved and displayed on my local file camera.\n\n\n## Local file camera\nNote that for development I am using a [file camera](https://www.home-assistant.io/components/camera.local_file/).\n```yaml\ncamera:\n  - platform: local_file\n    file_path: /images/thebeatles.jpg\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobmarkcole%2Fhass-machinebox-tagbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobmarkcole%2Fhass-machinebox-tagbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobmarkcole%2Fhass-machinebox-tagbox/lists"}