MVP for AI / @seosoft
フリーの技術屋です。MVP for AI / MCT Alumni です。
AIとかクラウドとかIoTとかをやってます。講師、コンテンツ開発もやってます。
お仕事のご相談はいつでも大歓迎。
乃木坂46と櫻坂46と日向坂46 が好きです。仏像とお寺と京都が好きです。
Global AI Night (2019/4/2) Cognitive Services と Logic Apps で AI をアプリケーションに組み込むワークショップ
License: MIT License
実行はされるようになりました!ありがとうございます。issue #5 の続きですが、今度は Custom Vision からのアウトプットが取得できていない感じのエラーが出ています。以下は raw output です。
{
"statusCode": 404,
"headers": {
"apim-request-id": "c5813f8c-de65-4b0d-92e4-9225f5555cb5",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"x-content-type-options": "nosniff",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "false",
"Date": "Fri, 29 Mar 2019 02:46:24 GMT",
"Content-Length": "99",
"Content-Type": "application/json"
},
"body": {
"Code": "NotFoundProjectDefaultIteration",
"Message": "Project has no default iteration"
}
}
昨日できなかったので、英語版をみながら、Azure の UI も英語にしてやってみました。
が、やっぱり Task 4 の Logic App の最後で Blob に画像をアップロードしても Logic App がキックされない感じです。
Logic App の Code View から UUID 的なのを置きかえた JSON を貼っておきます。僕だけだったら良いんですが。
{
"$connections": {
"value": {
"azureblob": {
"connectionId": "/subscriptions/XXXXXXXXXXXXX/resourceGroups/AINights/providers/Microsoft.Web/connections/azureblob",
"connectionName": "azureblob",
"id": "/subscriptions/XXXXXXXXXXXXX/providers/Microsoft.Web/locations/southeastasia/managedApis/azureblob"
},
"azureeventgrid": {
"connectionId": "/subscriptions/XXXXXXXXXXXXX/resourceGroups/AINights/providers/Microsoft.Web/connections/azureeventgrid",
"connectionName": "azureeventgrid",
"id": "/subscriptions/XXXXXXXXXXXXX/providers/Microsoft.Web/locations/southeastasia/managedApis/azureeventgrid"
},
"cognitiveservicescustomvision": {
"connectionId": "/subscriptions/XXXXXXXXXXXXX/resourceGroups/AINights/providers/Microsoft.Web/connections/cognitiveservicescustomvision",
"connectionName": "cognitiveservicescustomvision",
"id": "/subscriptions/XXXXXXXXXXXXX/providers/Microsoft.Web/locations/southeastasia/managedApis/cognitiveservicescustomvision"
}
}
},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each": {
"actions": {
"Condition": {
"actions": {
"Create_blob": {
"inputs": {
"body": "@{items('For_each')?['Tag']}:@{items('For_each')?['Probability']}",
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "post",
"path": "/datasets/default/files",
"queries": {
"folderPath": "/results",
"name": "result-@{body('Predict_tags_from_image_URL')?['Id']}",
"queryParametersSingleEncoded": true
}
},
"runAfter": {},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
},
"type": "ApiConnection"
}
},
"expression": {
"and": [
{
"greater": [
"@items('For_each')?['Probability']",
0.7
]
}
]
},
"runAfter": {},
"type": "If"
}
},
"foreach": "@body('Predict_tags_from_image_URL')?['Predictions']",
"runAfter": {
"Predict_tags_from_image_URL": [
"Succeeded"
]
},
"type": "Foreach"
},
"Parse_JSON": {
"inputs": {
"content": "@triggerBody()",
"schema": {
"properties": {
"data": {
"properties": {
"api": {
"type": "string"
},
"blobType": {
"type": "string"
},
"clientRequestId": {
"type": "string"
},
"contentLength": {
"type": "integer"
},
"contentType": {
"type": "string"
},
"eTag": {
"type": "string"
},
"requestId": {
"type": "string"
},
"sequencer": {
"type": "string"
},
"storageDiagnostics": {
"properties": {
"batchId": {
"type": "string"
}
},
"type": "object"
},
"url": {
"type": "string"
}
},
"type": "object"
},
"dataVersion": {
"type": "string"
},
"eventTime": {
"type": "string"
},
"eventType": {
"type": "string"
},
"id": {
"type": "string"
},
"metadataVersion": {
"type": "string"
},
"subject": {
"type": "string"
},
"topic": {
"type": "string"
}
},
"type": "object"
}
},
"runAfter": {},
"type": "ParseJson"
},
"Predict_tags_from_image_URL": {
"inputs": {
"body": {
"Url": "@body('Parse_JSON')?['data']?['url']"
},
"headers": {
"Content-Type": " application/json"
},
"host": {
"connection": {
"name": "@parameters('$connections')['cognitiveservicescustomvision']['connectionId']"
}
},
"method": "post",
"path": "/customvision/v1.0/Prediction/@{encodeURIComponent('YYYYYYYYYYYYYYYY')}/url"
},
"runAfter": {
"Parse_JSON": [
"Succeeded"
]
},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"When_a_resource_event_occurs": {
"inputs": {
"body": {
"properties": {
"destination": {
"endpointType": "webhook",
"properties": {
"endpointUrl": "@{listCallbackUrl()}"
}
},
"filter": {
"includedEventTypes": [
"Microsoft.Storage.BlobCreated"
]
},
"topic": "/subscriptions/XXXXXXXXXXXXX/resourceGroups/AINights/providers/Microsoft.Storage/storageAccounts/ainightsstoryt"
}
},
"host": {
"connection": {
"name": "@parameters('$connections')['azureeventgrid']['connectionId']"
}
},
"path": "/subscriptions/@{encodeURIComponent('XXXXXXXXXXXXX')}/providers/@{encodeURIComponent('Microsoft.Storage.StorageAccounts')}/resource/eventSubscriptions",
"queries": {
"x-ms-api-version": "2017-06-15-preview"
}
},
"splitOn": "@triggerBody()",
"type": "ApiConnectionWebhook"
}
}
}
}
Official には PR あげときました。Mergeされたら対応します。Mergeされなかったら、訳注で対応しようと思います。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.