{"id":15291189,"url":"https://github.com/azure/azurevision","last_synced_at":"2025-10-07T04:30:56.268Z","repository":{"id":56935526,"uuid":"209221385","full_name":"Azure/AzureVision","owner":"Azure","description":"R interface to the Computer Vision API","archived":true,"fork":false,"pushed_at":"2021-01-12T19:35:02.000Z","size":996,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-09-30T16:11:17.106Z","etag":null,"topics":["azure-cognitive-services","azure-sdk-r","computer-vision","custom-vision","r"],"latest_commit_sha":null,"homepage":null,"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/Azure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2019-09-18T05:01:10.000Z","updated_at":"2024-02-15T09:48:42.000Z","dependencies_parsed_at":"2022-08-21T01:10:17.164Z","dependency_job_id":null,"html_url":"https://github.com/Azure/AzureVision","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2FAzureVision","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2FAzureVision/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2FAzureVision/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2FAzureVision/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/AzureVision/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219877408,"owners_count":16554881,"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":["azure-cognitive-services","azure-sdk-r","computer-vision","custom-vision","r"],"created_at":"2024-09-30T16:11:21.059Z","updated_at":"2025-10-07T04:30:55.891Z","avatar_url":"https://github.com/Azure.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AzureVision \u003cimg src=\"man/figures/logo.png\" align=\"right\" width=150 /\u003e\r\n\r\n[![CRAN](https://www.r-pkg.org/badges/version/AzureVision)](https://cran.r-project.org/package=AzureVision)\r\n![Downloads](https://cranlogs.r-pkg.org/badges/AzureVision)\r\n![R-CMD-check](https://github.com/Azure/AzureVision/workflows/R-CMD-check/badge.svg)\r\n\r\n\r\nAn R frontend to [Azure Computer Vision](https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/) and [Azure Custom Vision](https://azure.microsoft.com/en-us/services/cognitive-services/custom-vision-service/), building on the low-level functionality provided by the [AzureCognitive](https://github.com/Azure/AzureCognitive) package. These services let you leverage the cloud to carry out visual recognition tasks using advanced image processing models, without needing powerful hardware of your own.\r\n\r\nThe primary repo for this package is at https://github.com/Azure/AzureVision; please submit issues and PRs there. It is also mirrored at the Cloudyr org at https://github.com/cloudyr/AzureVision. You can install the development version of the package with `devtools::install_github(\"Azure/AzureVision\")`.\r\n\r\n## Computer Vision\r\n\r\nTo communicate with the Computer Vision service, call the `computervision_endpoint` function with the service URL and key. Rather than a key, you can also supply an OAuth token obtained with the AzureAuth package.\r\n\r\n```r\r\nlibrary(AzureVision)\r\n\r\nvis \u003c- computervision_endpoint(\r\n    url=\"https://accountname.cognitiveservices.azure.com/\",\r\n    key=\"account_key\"\r\n)\r\n\r\n# images can be specified as a filename, Internet URL, or raw vector\r\nbill_url \u003c- \"https://news.microsoft.com/uploads/2014/09/billg1_print.jpg\"\r\nanalyze(vis, bill_url)\r\n# $categories\r\n#      name    score\r\n# 1 people_ 0.953125\r\n\r\ndescribe(vis, bill_url)\r\n# $tags\r\n#  [1] \"person\"   \"man\"      \"suit\"     \"clothing\" \"necktie\"  \"wearing\"  \"glasses\"  \"looking\"  \"holding\"  \"standing\" \"older\"   \r\n# [12] \"posing\"   \"business\" \"old\"      \"dressed\"  \"front\"    \"sitting\"  \"black\"    \"hat\"      \"white\"    \"sign\"     \"phone\"   \r\n\r\n# $captions\r\n#                                text confidence\r\n# 1 Bill Gates wearing a suit and tie  0.9954072\r\n```\r\n\r\n## Custom Vision\r\n\r\nCustom Vision defines two different types of endpoint: a training endpoint, and a prediction endpoint. To communicate with these, call the `customvision_training_endpoint` and `customvision_prediction_endpoint` functions with the service URL and key.\r\n\r\n```r\r\n# training a model\r\ncusvis \u003c- customvision_training_endpoint(\r\n    url=\"https://location.api.cognitive.microsoft.com/\",\r\n    key=\"training_key\"\r\n)\r\n\r\n# different projects can exist on the one endpoint\r\nlist_projects(cusvis)\r\n\r\n# create a classification project (one tag/label per image)\r\nproj \u003c- create_classification_project(cusvis, \"myproject\")\r\n\r\nimg1 \u003c- dir(\"path/to/images/tag1\", full.names=TRUE)\r\nimg2 \u003c- dir(\"path/to/images/tag2\", full.names=TRUE)\r\nadd_images(proj, img1, tags=\"tag1\")\r\nadd_images(proj, img2, tags=\"tag2\")\r\n\r\n# train the model\r\nmod \u003c- train_model(proj)\r\n\r\n# publish to the prediction resource (use AzureRMR framework to get resource ID)\r\npred_res \u003c- AzureRMR::get_azure_login(\"mytenant\")$\r\n    get_subscription(\"sub_id\")$\r\n    get_resource_group(\"rgname\")$\r\n    get_cognitive_service(\"cusvis_prediction\")\r\n\r\npublish_model(mod, \"mymodel\", pred_res)\r\n\r\n# get predictions from the prediction endpoint\r\ncusvis_pred \u003c- customvision_prediction_endpoint(\r\n    url=\"https://location.api.cognitive.microsoft.com/\",\r\n    key=\"prediction_key\"\r\n)\r\n\r\n# must supply project ID to access the published service\r\nproject_id \u003c- proj$project$id\r\ncusvis_service \u003c- classification_service(cusvis_pred, project_id, \"mymodel\")\r\n\r\npredict(cusvis_service, \"testimage.jpg\")\r\n```\r\n\r\n## Resource Manager interface\r\n\r\nYou can create Computer Vision and Custom Vision resources using the AzureRMR framework.\r\n\r\nFor Computer Vision, the available service tiers are `F0` (free, limited to 20 API calls per minute and 5k calls per month) and `S1` (up to 10 calls per second). For Custom Vision, the tiers are `F0` (free, limited to 2 projects for training and 10k transactions/month for prediction) and `S0`. Note that Custom Vision requires at least _two_ resources: one for training, and the other for prediction.\r\n\r\n```r\r\nrg \u003c- AzureRMR::get_azure_login(\"yourtenant\")$\r\n    get_subscription(\"sub_id\")$\r\n    get_resource_group(\"rgname\")\r\n\r\n# Computer Vision\r\nrg$create_cognitive_service(\"myvis\", service_type=\"ComputerVision\", service_tier=\"S1\")\r\n\r\n# Custom Vision (training and prediction)\r\nrg$create_cognitive_service(\"mycustvis\", service_type=\"CustomVision\", service_tier=\"S0\")\r\nrg$create_cognitive_service(\"mycustvispred\", service_type=\"CustomVision.Prediction\", service_tier=\"S0\")\r\n```\r\n\r\n----\r\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/Azure/AzureR\"\u003e\u003cimg src=\"https://github.com/Azure/AzureR/raw/master/images/logo2.png\" width=800 /\u003e\u003c/a\u003e\u003c/p\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fazurevision","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fazurevision","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fazurevision/lists"}