{"id":13815105,"url":"https://github.com/simonw/blip-caption","last_synced_at":"2025-07-23T17:08:30.849Z","repository":{"id":193808531,"uuid":"689538062","full_name":"simonw/blip-caption","owner":"simonw","description":"Generate captions for images with Salesforce BLIP","archived":false,"fork":false,"pushed_at":"2024-07-11T09:52:49.000Z","size":5,"stargazers_count":120,"open_issues_count":7,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-28T03:06:25.432Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-09-10T05:57:22.000Z","updated_at":"2025-06-26T13:25:47.000Z","dependencies_parsed_at":"2023-09-10T06:33:07.407Z","dependency_job_id":"fc053a5d-414b-412b-8984-cd9eb26201d9","html_url":"https://github.com/simonw/blip-caption","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"2c08abb7828813f39f77fd5a0a0b11c99f925d89"},"previous_names":["simonw/blip-caption"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/simonw/blip-caption","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fblip-caption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fblip-caption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fblip-caption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fblip-caption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonw","download_url":"https://codeload.github.com/simonw/blip-caption/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fblip-caption/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266717708,"owners_count":23973384,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-08-04T04:02:58.044Z","updated_at":"2025-07-23T17:08:30.826Z","avatar_url":"https://github.com/simonw.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# blip-caption\n\n[![PyPI](https://img.shields.io/pypi/v/blip-caption.svg)](https://pypi.org/project/blip-caption/)\n[![Changelog](https://img.shields.io/github/v/release/simonw/blip-caption?include_prereleases\u0026label=changelog)](https://github.com/simonw/blip-caption/releases)\n[![Tests](https://github.com/simonw/blip-caption/workflows/Test/badge.svg)](https://github.com/simonw/blip-caption/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/blip-caption/blob/main/LICENSE)\n\nA CLI tool for generating captions for images using [Salesforce BLIP](https://huggingface.co/Salesforce/blip-image-captioning-base).\n\n## Installation\n\nInstall this tool using `pip` or `pipx`:\n```bash\npipx install blip-caption\n```\nThe first time you use the tool it will download the model from the Hugging Face model hub.\n\nThe small model is 945MB. The large model is 1.8GB. The models will be downloaded and stored in `~/.cache/huggingface/hub/` the first time you use them.\n\n## Usage\n\nTo generate captions for an image using the small model, run:\n\n```bash\nblip-caption IMG_5825.jpeg\n```\nExample output:\n```\na lizard is sitting on a branch in the woods\n```\nTo use the larger model, add `--large`:\n```bash\nblip-caption IMG_5825.jpeg --large\n```\nExample output:\n```\nthere is a chamelon sitting on a branch in the woods\n```\nHere's [the image I used](https://static.simonwillison.net/static/2023/IMG_5924.jpeg):\n\n![It is ineded a chameleon](https://static.simonwillison.net/static/2023/IMG_5924.jpeg)\n\nIf you pass multiple files the path to each file will be output before its caption:\n\n```bash\nblip-caption /tmp/photos/*.jpeg\n/tmp/photos/IMG_2146.jpeg\na man holding a bowl of salad and laughing\n/tmp/photos/IMG_0151.jpeg\na cat laying on a red blanket\n```\n\n## JSON output\n\nThe `--json` flag changes the output to look like this:\n\n```\nblip-caption /tmp/photos/*.* --json\n```\n```json\n[{\"path\": \"/tmp/photos/IMG_2146.jpeg\", \"caption\": \"a man holding a bowl of salad and laughing\"},\n {\"path\": \"/tmp/photos/IMG_0151.jpeg\", \"caption\": \"a cat laying on a red blanket\"},\n {\"path\": \"/tmp/photos/IMG_3099.MOV\", \"error\": \"cannot identify image file '/tmp/photos/IMG_3099.MOV'\"}]\n```\nAny errors are returned as a `{\"path\": \"...\", \"error\": \"error message\"}` object.\n\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd blip-caption\npython3 -m venv venv\nsource venv/bin/activate\n```\nNow install the dependencies and test dependencies:\n```bash\npip install -e '.[test]'\n```\nTo run the tests:\n```bash\npytest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonw%2Fblip-caption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonw%2Fblip-caption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonw%2Fblip-caption/lists"}