calesthio/google-cloud-vision
Use this skill when an agent needs Google Cloud Vision API for still-image understanding: labels, object localization, OCR, document text, SafeSearch, image properties, crop hints, web detection, batch annotation, Cloud Storage based pipelines, confidence evaluation, privacy, quotas, cost, and QA. Do not use it for Gemini multimodal reasoning, video analysis, image generation, custom model training, product catalog search design, or human reference/authenticity review.
npx skills add https://github.com/calesthio/generative-media-skills --skill google-cloud-vision
Use Google Cloud Vision when the production task needs structured annotations from still images: general labels, object boxes, text/OCR, dense document text, explicit-content likelihoods, dominant colors, crop suggestions, or web-reference signals. Treat it as a computer-vision annotation service, not as a conversational image reasoner.
Verified on 2026-07-11 against first-party Google Cloud documentation whose Cloud Vision pages were last updated 2026-07-07 unless otherwise noted. Pricing, quotas, endpoints, product lifecycle, supported features, and model behavior are volatile; recheck the linked Google pages before promising a production SLA, budget, data-region commitment, or migration path.
Documented fact: Cloud Vision API feature types include TEXT_DETECTION, DOCUMENT_TEXT_DETECTION, LABEL_DETECTION, OBJECT_LOCALIZATION, SAFE_SEARCH_DETECTION, IMAGE_PROPERTIES, CROP_HINTS, and WEB_DETECTION, among other features such as landmarks, logos, and faces. Source: Google Cloud Vision features list, verified 2026-07-11.
Use Cloud Vision for:
Do not use Cloud Vision as the primary tool for:
WEB_DETECTION can return matching pages/images and inferred web entities, but it does not prove authorship, license, consent, manipulation history, source-of-truth identity, or rights clearance. Use it as evidence collection for a human reviewer, not as the reviewer.Documented facts below are from the Google Cloud Vision feature docs, verified 2026-07-11.
| Need | Request feature | Output to expect | Production notes |
| --- | --- | --- | --- |
| Sparse text in a photo, sign, label, package, screenshot region | TEXT_DETECTION | textAnnotations plus fullTextAnnotation; extracted UTF-8 text, words, bounding boxes | Use for text embedded in broader imagery. Do not force language hints unless the language is known; Google says empty hints usually yield best automatic detection, and wrong hints can hinder results. |
| Dense page, scanned form, document image, handwriting, PDF/TIFF OCR | DOCUMENT_TEXT_DETECTION | fullTextAnnotation hierarchy: Page -> Block -> Paragraph -> Word -> Symbol; dense document structure | Takes precedence if both OCR features are requested. Use Document AI instead when you need structured form parsing, entity extraction, document workflows, or specialized processors. |
| General image tags | LABEL_DETECTION | labelAnnotations with description, score, topicality, and MID | Good for search tags and coarse categorization. Do not treat labels as exhaustive or mutually exclusive taxonomy. |
| Objects with locations | OBJECT_LOCALIZATION | localizedObjectAnnotations with English object names, scores, MIDs, and normalized vertices in [0,1] | Use for bounding-box workflows. Labels are returned in English; translate downstream if needed. |
| Explicit-content prefilter | SAFE_SEARCH_DETECTION | Likelihoods for adult, spoof, medical, violence, and racy: UNKNOWN, VERY_UNLIKELY, UNLIKELY, POSSIBLE, LIKELY, VERY_LIKELY | Design policy thresholds per category. Do not collapse the five categories into one opaque score without documenting why. |
| Dominant colors | IMAGE_PROPERTIES | Dominant RGBA colors, score, pixel fraction | Google says ColorInfo does not carry absolute color-space info; assume sRGB unless your pipeline controls color management. |
| Automated crop suggestions | CROP_HINTS | Crop polygons, confidence, importance fraction; optional aspect ratios | You can supply up to 16 width:height aspect ratios. Crop hints are saliency suggestions, not art direction; check brand, faces, product edges, and text manually or with additional rules. |
| Web context and reverse-image-like signals | WEB_DETECTION | Web entities, full matching images, partial matches, pages with matching images, visually similar images, best-guess labels | Useful for asset triage and context discovery. It is not a license search, provenance guarantee, or fact-checking authority. |
Documented fact: TEXT_DETECTION is optimized for sparse areas of text within a larger image. DOCUMENT_TEXT_DETECTION is optimized for dense text, document images, handwriting, and PDF/TIFF file OCR, and it takes precedence when both OCR features are requested. Source: OCR docs and features list, verified 2026-07-11.
Production heuristic: choose OCR by the visual shape of the image, not by the file extension alone. A product photo with a nutrition label may need TEXT_DETECTION for quick copy extraction, while a phone photo of a printed invoice should usually use DOCUMENT_TEXT_DETECTION because block/paragraph/word structure is valuable.
Documented fact: Cloud Vision's fullTextAnnotation organizes extracted UTF-8 text as Page -> Block -> Paragraph -> Word -> Symbol, with bounding boxes and per-component properties. The older textAnnotations output continues to be supported. Source: dense document text tutorial, verified 2026-07-11.
Production heuristic: evaluate OCR output at the unit your downstream workflow consumes. For search indexing, document-level text recall may be enough. For captions, forms, or layout-sensitive design review, measure word-level accuracy, bounding-box placement, reading order, line breaks, and confidence behavior separately.
Documented fact: synchronous images:annotate returns inline annotations and accepts up to 16 images per request. Offline asynchronous images:asyncBatchAnnotate starts a long-running operation and writes JSON output to a Cloud Storage bucket; it accepts up to 2000 image files per request. Source: batch image annotation and quotas, verified 2026-07-11.
Documented fact: file annotation has separate limits. Synchronous files:annotate can annotate one file and up to 5 pages. Asynchronous files:asyncBatchAnnotate can annotate up to 2000 pages per PDF/TIFF file and writes JSON to Cloud Storage. Source: batch, PDF/TIFF OCR, and quotas, verified 2026-07-11.
Documented fact: for PDF/TIFF offline large batch annotation, Google currently supports only DOCUMENT_TEXT_DETECTION and TEXT_DETECTION; the file must be in Cloud Storage, output is written to Cloud Storage, and API keys are not supported for files:asyncBatchAnnotate. The authenticating account must have access to the input and write permission to the output bucket; Google names roles/editor or roles/storage.objectCreator or above for output creation in its PDF/TIFF docs. Source: PDF/TIFF OCR, verified 2026-07-11.
Documented fact: Cloud Vision can fetch remote HTTP/HTTPS image URLs, but Google warns that completion is not guaranteed because hosts can deny, throttle, or be throttled for abuse-prevention reasons; Google recommends not depending on externally hosted images for production. Source: multiple Cloud Vision feature docs, verified 2026-07-11.
Production heuristic: in production, copy user-supplied or third-party images into a controlled Cloud Storage bucket before annotation. This gives stable access, uniform IAM, retryability, lifecycle rules, audit logs, and cleaner deletion.
Production checklist for Cloud Storage pipelines:
Documented fact: for OCR features (TEXT_DETECTION and DOCUMENT_TEXT_DETECTION), Cloud Vision supports the global endpoint plus region-based endpoints for United States and European Union processing/storage: us-vision.googleapis.com and eu-vision.googleapis.com. Google says this regional functionality currently only applies to OCR. Source: OCR docs and PDF/TIFF OCR, verified 2026-07-11.
Documented fact: Google says it does not use content sent to Vision API for purposes other than providing the service, does not make submitted content public, does not use submitted content to train/improve Cloud Vision features, and does not claim ownership of submitted content. For online operations, image data is processed in memory and not persisted to disk. For asynchronous offline batch operations, Google stores the image briefly to perform analysis and return results, typically deleting it after processing with a failsafe TTL of a few hours. Google also temporarily logs metadata such as request time and request size. Source: Cloud Vision Data Usage FAQ, verified 2026-07-11.
Production heuristic: privacy obligations do not end at the API boundary. Check whether the image contains faces, IDs, minors, medical content, location data, documents, or confidential products. Minimize retention in your own buckets, avoid public URLs, redact before annotation when the task permits, and keep the annotation JSON under the same access controls as the source image.
Documented facts from Google Cloud Vision quotas and pricing, verified 2026-07-11:
images:annotate, 2000 images per images:asyncBatchAnnotate, 5 pages per files:annotate, and 2000 pages per files:asyncBatchAnnotate.Production heuristic: estimate cost as:
billable_units = number_of_images_or_pages * number_of_paid_features_per_image
Then adjust for bundle behavior such as SafeSearch with Label Detection and Crop Hints with Image Properties, free monthly tier, downstream Cloud Storage charges, retries, failed-item handling, and non-USD SKU pricing.
Documented fact: Cloud Vision returns feature-specific scores, likelihood enums, bounding polygons, normalized vertices, confidence values, topicality values, crop importance fractions, and web entity/match fields depending on feature. Source: Cloud Vision feature docs and response examples, verified 2026-07-11.
Production heuristics for evaluation:
adult and racy may drive age gates, while medical should not automatically suppress legitimate health or educational material.Documented fact: Vision API Product Search lets retailers create products with reference images, group products into product sets, and query with user images to return visually and semantically similar products. It supports product categories including homegoods, apparel, toys, packaged goods, and general. Source: Vision API Product Search docs, verified 2026-07-11.
Documented fact: the Product Search documentation currently displays a maintenance-mode notice: "The Product Search feature is in maintenance mode. For better scalability and the same functionality as Product Search, use the Vision Warehouse." Source: Vision API Product Search docs, verified 2026-07-11.
Production heuristic: do not design new catalog search systems around legacy Product Search without validating the lifecycle and Vision Warehouse migration path with current Google docs and account support. For simple one-off tagging or object detection, standard Cloud Vision may be enough. For custom business taxonomies, train/evaluate a custom model path. For ecommerce visual similarity at scale, evaluate Vision Warehouse/current Google retail search offerings rather than assuming Cloud Vision label/object APIs are catalog search.
pass, review, or block with reasons.Example, not a mandatory formula.
Production intent: tag incoming still images for a media library, identify major objects, prefilter explicit content, extract sparse text, and store enough raw data for QA.
Provider and feature choice: Cloud Vision LABEL_DETECTION, OBJECT_LOCALIZATION, SAFE_SEARCH_DETECTION, and TEXT_DETECTION on controlled Cloud Storage inputs. This is better than Gemini because the pipeline needs structured fields and repeatable thresholds, not a prose description.
Inputs and constraints:
gs://media-intake-prod/raw/YYYY/MM/DD/....adult or violence value of LIKELY or VERY_LIKELY routes to review before publication.Complete REST request body:
{
"requests": [
{
"image": {
"source": {
"imageUri": "gs://media-intake-prod/raw/2026/07/11/example.jpg"
}
},
"features": [
{ "type": "LABEL_DETECTION", "maxResults": 20 },
{ "type": "OBJECT_LOCALIZATION", "maxResults": 20 },
{ "type": "SAFE_SEARCH_DETECTION" },
{ "type": "TEXT_DETECTION" }
]
}
]
}
Interpretation plan:
score >= 0.80 as publishable candidate tags only if they are on the approved vocabulary list.0.55 <= score < 0.80 as internal search-only tags.normalizedVertices to pixel coordinates for reviewer overlays.LIKELY/VERY_LIKELY in adult or violence to human review; do not auto-delete.Why structured this way: Cloud Vision bills each selected feature, so the request includes only features used by downstream decisions. The thresholds are production policy, not provider truth; they must be calibrated with a labeled sample.
Likely failure modes:
Meaningful variations:
IMAGE_PROPERTIES and CROP_HINTS when the asset pipeline also produces color palettes and social crops.TEXT_DETECTION when images never contain useful text.Example, not a mandatory formula.
Production intent: extract text from scanned PDF statements for internal search and document routing.
Provider and feature choice: Cloud Vision files:asyncBatchAnnotate with DOCUMENT_TEXT_DETECTION, because the input is a multi-page dense document in Cloud Storage. Consider Document AI instead if the goal is to parse fields, tables, entities, forms, or invoices into structured business records.
Inputs and constraints:
gs://doc-intake-prod/incoming/acct-1931.pdf.gs://doc-intake-prod/vision-output/acct-1931/.Complete REST request body:
{
"requests": [
{
"inputConfig": {
"gcsSource": {
"uri": "gs://doc-intake-prod/incoming/acct-1931.pdf"
},
"mimeType": "application/pdf"
},
"features": [
{
"type": "DOCUMENT_TEXT_DETECTION"
}
],
"outputConfig": {
"gcsDestination": {
"uri": "gs://doc-intake-prod/vision-output/acct-1931/"
},
"batchSize": 10
}
}
]
}
HTTP endpoint:
POST https://vision.googleapis.com/v1/files:asyncBatchAnnotate
Expected result: the initial response returns a long-running operation name. When the operation state is DONE, JSON output files appear under the destination prefix. Each output resembles image OCR output and includes context about the source file and page range.
QA plan:
Likely failure modes:
Meaningful variations:
eu-vision.googleapis.com or us-vision.googleapis.com regional endpoints for OCR when regional processing/storage requirements apply and current docs still support the needed method.TEXT_DETECTION instead if the file contains sparse text and dense structure is unnecessary.Example, not a mandatory formula.
Production intent: prepare editorial images for 1:1, 4:5, and 9:16 social placements while preserving subjects, text, product edges, and brand colors.
Provider and feature choice: Cloud Vision CROP_HINTS plus IMAGE_PROPERTIES. Crop hints give candidate polygons for requested aspect ratios; image properties provide dominant colors for layout theming or contrast checks.
Inputs and constraints:
gs://campaign-prod/selects/hero-014.jpg.Complete REST request body:
{
"requests": [
{
"image": {
"source": {
"imageUri": "gs://campaign-prod/selects/hero-014.jpg"
}
},
"features": [
{ "type": "CROP_HINTS" },
{ "type": "IMAGE_PROPERTIES", "maxResults": 10 }
],
"imageContext": {
"cropHintsParams": {
"aspectRatios": [1.0, 0.8, 0.5625]
}
}
}
]
}
Interpretation plan:
x or y values as zero because Google omits zero coordinate fields in JSON bounding polygons.Why structured this way: crop hints automate first-pass saliency, but final crops are production design decisions. The response's confidence and importanceFraction help rank candidates, not approve them automatically.
Likely failure modes:
Meaningful variations:
OBJECT_LOCALIZATION if products must remain fully inside the crop.Primary first-party sources consulted and verified 2026-07-11:
Take calesthio/google-cloud-vision from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.