Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 15, 2024. It is now read-only.
/AzureVisionPublic archive

R interface to the Computer Vision API

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

Azure/AzureVision

CRANDownloadsR-CMD-check

An R frontend toAzure Computer Vision andAzure Custom Vision, building on the low-level functionality provided by theAzureCognitive 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.

The primary repo for this package is athttps://github.com/Azure/AzureVision; please submit issues and PRs there. It is also mirrored at the Cloudyr org athttps://github.com/cloudyr/AzureVision. You can install the development version of the package withdevtools::install_github("Azure/AzureVision").

Computer Vision

To communicate with the Computer Vision service, call thecomputervision_endpoint function with the service URL and key. Rather than a key, you can also supply an OAuth token obtained with the AzureAuth package.

library(AzureVision)vis<- computervision_endpoint(url="https://accountname.cognitiveservices.azure.com/",key="account_key")# images can be specified as a filename, Internet URL, or raw vectorbill_url<-"https://news.microsoft.com/uploads/2014/09/billg1_print.jpg"analyze(vis,bill_url)# $categories#      name    score# 1 people_ 0.953125describe(vis,bill_url)# $tags#  [1] "person"   "man"      "suit"     "clothing" "necktie"  "wearing"  "glasses"  "looking"  "holding"  "standing" "older"# [12] "posing"   "business" "old"      "dressed"  "front"    "sitting"  "black"    "hat"      "white"    "sign"     "phone"# $captions#                                text confidence# 1 Bill Gates wearing a suit and tie  0.9954072

Custom Vision

Custom Vision defines two different types of endpoint: a training endpoint, and a prediction endpoint. To communicate with these, call thecustomvision_training_endpoint andcustomvision_prediction_endpoint functions with the service URL and key.

# training a modelcusvis<- customvision_training_endpoint(url="https://location.api.cognitive.microsoft.com/",key="training_key")# different projects can exist on the one endpointlist_projects(cusvis)# create a classification project (one tag/label per image)proj<- create_classification_project(cusvis,"myproject")img1<- dir("path/to/images/tag1",full.names=TRUE)img2<- dir("path/to/images/tag2",full.names=TRUE)add_images(proj,img1,tags="tag1")add_images(proj,img2,tags="tag2")# train the modelmod<- train_model(proj)# publish to the prediction resource (use AzureRMR framework to get resource ID)pred_res<-AzureRMR::get_azure_login("mytenant")$    get_subscription("sub_id")$    get_resource_group("rgname")$    get_cognitive_service("cusvis_prediction")publish_model(mod,"mymodel",pred_res)# get predictions from the prediction endpointcusvis_pred<- customvision_prediction_endpoint(url="https://location.api.cognitive.microsoft.com/",key="prediction_key")# must supply project ID to access the published serviceproject_id<-proj$project$idcusvis_service<- classification_service(cusvis_pred,project_id,"mymodel")predict(cusvis_service,"testimage.jpg")

Resource Manager interface

You can create Computer Vision and Custom Vision resources using the AzureRMR framework.

For Computer Vision, the available service tiers areF0 (free, limited to 20 API calls per minute and 5k calls per month) andS1 (up to 10 calls per second). For Custom Vision, the tiers areF0 (free, limited to 2 projects for training and 10k transactions/month for prediction) andS0. Note that Custom Vision requires at leasttwo resources: one for training, and the other for prediction.

rg<-AzureRMR::get_azure_login("yourtenant")$    get_subscription("sub_id")$    get_resource_group("rgname")# Computer Visionrg$create_cognitive_service("myvis",service_type="ComputerVision",service_tier="S1")# Custom Vision (training and prediction)rg$create_cognitive_service("mycustvis",service_type="CustomVision",service_tier="S0")rg$create_cognitive_service("mycustvispred",service_type="CustomVision.Prediction",service_tier="S0")

About

R interface to the Computer Vision API

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp