{"id":28387869,"url":"https://github.com/cloudyr/googlecloudvisionr","last_synced_at":"2025-08-22T20:23:18.660Z","repository":{"id":56936527,"uuid":"186001686","full_name":"cloudyr/googleCloudVisionR","owner":"cloudyr","description":"Google Cloud Vision API to R","archived":false,"fork":false,"pushed_at":"2020-04-02T09:19:02.000Z","size":1753,"stargazers_count":8,"open_issues_count":7,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-31T02:26:04.977Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://cloudyr.github.io/googleCloudVisionR/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudyr.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":"2019-05-10T14:25:04.000Z","updated_at":"2025-03-24T02:22:27.000Z","dependencies_parsed_at":"2022-08-21T07:20:45.152Z","dependency_job_id":null,"html_url":"https://github.com/cloudyr/googleCloudVisionR","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cloudyr/googleCloudVisionR","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudyr%2FgoogleCloudVisionR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudyr%2FgoogleCloudVisionR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudyr%2FgoogleCloudVisionR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudyr%2FgoogleCloudVisionR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudyr","download_url":"https://codeload.github.com/cloudyr/googleCloudVisionR/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudyr%2FgoogleCloudVisionR/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262879219,"owners_count":23378577,"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":"2025-05-30T19:35:53.269Z","updated_at":"2025-07-01T01:33:47.914Z","avatar_url":"https://github.com/cloudyr.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# googleCloudVisionR\n[![Travis build status](https://travis-ci.org/cloudyr/googleCloudVisionR.svg?branch=master)](https://travis-ci.org/cloudyr/googleCloudVisionR)\n[![Codecov test coverage](https://codecov.io/gh/cloudyr/googleCloudVisionR/branch/master/graph/badge.svg)](https://codecov.io/gh/cloudyr/googleCloudVisionR?branch=master)\n\nR Package for Image Recognition, Object Detection, and OCR using the Google Cloud Vision API.\n\n## Google Cloud Vision API\n\n\u003e **Cloud Vision API** enables developers to understand the content of an image by encapsulating powerful machine learning models in an easy-to-use REST API. It quickly classifies images into thousands of categories (such as, “sailboat”), detects individual objects and faces within images, and reads printed words contained within images. You can build metadata on your image catalog, moderate offensive content, or enable new marketing scenarios through image sentiment analysis.\n\nRead more on the [capabilities of the Google Cloud Vision API](https://cloud.google.com/vision/).\n\n## About this R package\n\nThis package allows you to call the following functionalities: label, text, landmark, face and logo detection.\n\nThe project is a continuation of the [RoogleVision](https://github.com/cloudyr/RoogleVision) package\nby Florian Teschner and is relying on the authentication procedures offered by\n[googleAuthR](https://CRAN.R-project.org/package=googleAuthR).\n\n**WARNING**: the project is in active development and is not guaranteed to be stable in terms of\nfunction names, signatures, etc. Contributions through issues, pull requests are more than\nwelcome.\n\n\n## Installation\n\nv0.1.0 is already available on CRAN, you can install it with:\n```r\ninstall.packages(\"googleCloudVisionR\")\n```\n\n\nIf you need the latest version, just install the package directly from Github:\n``` r\ndevtools::install_github(\"cloudyr/googleCloudVisionR\")\n```\n\n## Authentication\n\nYou should use a `.json` file pertaining to a service account for authentication\nwhose path you should specify in an environment variable `GCV_AUTH_FILE`\nfor auto-authentication:\n\n```r\nSys.setenv(\"GCV_AUTH_FILE\" = \"/fullpath/to/auth.json\")\n```\n\nThis can alternatively be set on the command line or via an `Renviron.site` or\n`.Renviron` file (see [here](https://CRAN.R-project.org/package=httr/vignettes/api-packages.html) for instructions).\n\nIf this is set, upon loading the package authentication happens\nautomatically.\n\n```r\n# GCV_AUTH_FILE set so auto-authentication happens\nlibrary(googleCloudVisionR)\n#\u003e Successfully authenticated via /fullpath/to/auth.json\n```\n\n## Example\n\nLet us retrieve annotations for this image:\n![](man/figures/golden_retriever_puppies.jpg)\n\nLabel detection (default), with maximum 7 results returned per image:\n\n```r\nimagePath \u003c- system.file(\n    \"extdata\", \"golden_retriever_puppies.jpg\", package = \"googleCloudVisionR\"\n  )\ngcv_get_image_annotations(\n    imagePaths = imagePath,\n    feature = \"LABEL_DETECTION\",\n    maxNumResults = 7\n)\n\n#\u003e                      image_path       mid      description     score topicality\n#\u003e 1: golden_retriever_puppies.jpg /m/0bt9lr              Dog 0.9953705  0.9953705\n#\u003e 2: golden_retriever_puppies.jpg  /m/04rky           Mammal 0.9890478  0.9890478\n#\u003e 3: golden_retriever_puppies.jpg  /m/09686       Vertebrate 0.9851104  0.9851104\n#\u003e 4: golden_retriever_puppies.jpg  /m/01z5f          Canidae 0.9813780  0.9813780\n#\u003e 5: golden_retriever_puppies.jpg  /m/0kpmf        Dog breed 0.9683250  0.9683250\n#\u003e 6: golden_retriever_puppies.jpg /m/0d7s3w            Puppy 0.9400384  0.9400384\n#\u003e 7: golden_retriever_puppies.jpg /m/01t032 Golden retriever 0.8966703  0.8966703\n\n```\n\nAnnotation can also happen in batches, allowing for continuing previously\nstopped (or interrupted) annotations as well.\n\n```r\ngcv_get_image_annotations(\n    imagePaths = c(image_path_1, image_path_2,..., image_path_128),\n    batchSize = 64L,\n    savePath = \"path/to/annotation_file.csv\"\n)\n```\nHere we take 128 images and annotate them in batces of size 64.\nIf, for example, we have previously annotated the first batch of images\nwhose results have been stored in `savePath`, then only the leftovers\nare annotated. A dataframe with all annotations is returned and the\nnew set of annotations gets appended to `savePath`.\n\nImages can not only be read from local disk, but you can use URLs or Google Cloud Storage URIs as well:\n```r\ngcv_get_image_annotations(c(\n    \"https://bit.ly/2IhUzdE\",\n    \"gs://vision-api-handwriting-ocr-bucket/handwriting_image.png\"\n), maxNumResults = 2)\n\n#\u003e                                                      image_path        mid description     score topicality\n#\u003e 1:                                       https://bit.ly/2IhUzdE  /m/0bt9lr         Dog 0.9953705  0.9953705\n#\u003e 2:                                       https://bit.ly/2IhUzdE   /m/04rky      Mammal 0.9890478  0.9890478\n#\u003e 3: gs://vision-api-handwriting-ocr-bucket/handwriting_image.png /m/07s6nbt        Text 0.9540842  0.9540842\n#\u003e 4: gs://vision-api-handwriting-ocr-bucket/handwriting_image.png  /m/03scnj        Line 0.9027576  0.9027576\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudyr%2Fgooglecloudvisionr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudyr%2Fgooglecloudvisionr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudyr%2Fgooglecloudvisionr/lists"}