- NAME
-
- gcloud ml vision detect-text - detect and extract text within an image
- SYNOPSIS
-
-
gcloud ml vision detect-text
IMAGE_PATH
[--language-hints
=[LANGUAGE_HINTS
,…]] [GCLOUD_WIDE_FLAG …
]
-
- DESCRIPTION
-
Detect and extract text within an image.
Google Cloud Vision uses OCR (Optical Character Recognition) to detect text within an image, with support for a broad array of languages and automatic label detection.
Language hints can be provided to Google Cloud Vision API. In most cases, an empty value yields the best results since it enables automatic language detection. For languages based on the Latin alphabet, setting
language_hints
is not needed. Text detection returns an error if one or more of the specified languages is not one of the supported languages. (See https://cloud.google.com/vision/docs/languages.) To provide language hints run:gcloud ml vision detect-text --language-hints ja,ko
- EXAMPLES
-
To detect and extract text within an image 'gs://my_bucket/input_file':
gcloud ml vision detect-text gs://my_bucket/input_file
- POSITIONAL ARGUMENTS
-
IMAGE_PATH
- Path to the image to be analyzed. This can be either a local path or a URL. If you provide a local file, the contents will be sent directly to Google Cloud Vision. If you provide a URL, it must be in Google Cloud Storage format (gs://bucket/object) or an HTTP URL (http://... or https://…)
- FLAGS
-
--language-hints
=[LANGUAGE_HINTS
,…]- List of languages to use for text detection.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file
,--account
,--billing-project
,--configuration
,--flags-file
,--flatten
,--format
,--help
,--impersonate-service-account
,--log-http
,--project
,--quiet
,--trace-token
,--user-output-enabled
,--verbosity
.Run
$ gcloud help
for details. - API REFERENCE
-
This command uses the
vision/v1
API. The full documentation for this API can be found at: https://cloud.google.com/vision/ - NOTES
-
These variants are also available:
gcloud alpha ml vision detect-text
gcloud beta ml vision detect-text
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-02-06 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{
"last_modified": "Last updated 2024-02-06 UTC.",
"state": ""
}