赞
踩
Azure认知服务(语音合成产品系列)是微软云服务里面的明星产品,基于行业领先的Hifi-net语音模型打造,可以提供高质量神经网络版声音,发音更准确、韵律更自然、高保真并支持多种风格情感自然切换,该项产品已落地在各大媒体、短视频平台,以及智能汽车、智能手机与设备等诸多领域。
认知服务让每个开发人员都能使用 AI,而无需机器学习专业知识。只需 API 调用,即可将查看、收听、朗读、搜索、理解和加速决策的功能嵌入到应用中。
参考链接:什么是计算机视觉?
参考链接:什么是图像分析?
计算机视觉图像分析服务可以从图像中提取各种视觉特征。 例如,该服务可以确定图像是否包含成人内容、查找特定的品牌或对象,或查找人脸。
实验操作步骤
:
本文演示如何调用图像分析 API 以返回有关图像的视觉特征的信息。
使用的示例图片
csp-billing-usage: CognitiveServices.ComputerVision.Categories=1,CognitiveServices.ComputerVision.Landmarks=1,CognitiveServices.ComputerVision.Transaction=1 x-envoy-upstream-service-time: 16354 apim-request-id: 6b83e60b-81aa-4fd7-abd4-bef0892f389d Strict-Transport-Security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff Date: Fri, 22 Oct 2021 16:31:12 GMT Content-Length: 260 Content-Type: application/json; charset=utf-8 { "categories": [{ "name": "building_street", "score": 0.40234375, "detail": { "landmarks": [] } }, { "name": "outdoor_", "score": 0.00390625, "detail": { "landmarks": [] } }], "requestId": "6b83e60b-81aa-4fd7-abd4-bef0892f389d", "metadata": { "height": 4224, "width": 5632, "format": "Jpeg" } }
csp-billing-usage: CognitiveServices.ComputerVision.Description=1,CognitiveServices.ComputerVision.Landmarks=1,CognitiveServices.ComputerVision.Transaction=1 x-envoy-upstream-service-time: 12654 apim-request-id: b4c07513-3b10-40b9-858b-d5dc525d5d0b Strict-Transport-Security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff Date: Fri, 22 Oct 2021 16:35:57 GMT Content-Length: 591 Content-Type: application/json; charset=utf-8 { "categories": [{ "name": "建筑_街道", "score": 0.40234375, "detail": { "landmarks": [] } }, { "name": "户外_", "score": 0.00390625, "detail": { "landmarks": [] } }], "description": { "tags": ["户外", "草", "城市", "大", "体育", "田地", "男人", "站", "球", "绿色", "播放器", "橙子", "公园", "阴天", "空气", "飞行", "轨道", "骑", "飞机", "水", "火车", "街道", "人们", "播放", "院子", "风筝", "蓝色", "巴士"], "captions": [{ "text": "城市的风景", "confidence": 0.6212207909539402 }] }, "requestId": "b4c07513-3b10-40b9-858b-d5dc525d5d0b", "metadata": { "height": 4224, "width": 5632, "format": "Jpeg" } }
csp-billing-usage: CognitiveServices.ComputerVision.Landmarks=1,CognitiveServices.ComputerVision.Tags=1,CognitiveServices.ComputerVision.Transaction=1 x-envoy-upstream-service-time: 8701 apim-request-id: 3e22d834-63f6-4a6f-9faa-550d6c5e8b69 Strict-Transport-Security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff Date: Fri, 22 Oct 2021 16:44:33 GMT Content-Length: 825 Content-Type: application/json; charset=utf-8 { "categories": [{ "name": "建筑_街道", "score": 0.40234375, "detail": { "landmarks": [] } }, { "name": "户外_", "score": 0.00390625, "detail": { "landmarks": [] } }], "tags": [{ "name": "天空", "confidence": 0.9999513626098633 }, { "name": "户外", "confidence": 0.9900293350219727 }, { "name": "草", "confidence": 0.9896734952926636 }, { "name": "云", "confidence": 0.9334161281585693 }, { "name": "摩天楼", "confidence": 0.8285492658615112 }, { "name": "建筑", "confidence": 0.8191744089126587 }, { "name": "运动场/游乐场", "confidence": 0.7252355217933655 }, { "name": "运动", "confidence": 0.6510032415390015 }, { "name": "树", "confidence": 0.5010823011398315 }, { "name": "体育场", "confidence": 0.20338237285614014 }, { "name": "天", "confidence": 0.11071398854255676 }], "requestId": "3e22d834-63f6-4a6f-9faa-550d6c5e8b69", "metadata": { "height": 4224, "width": 5632, "format": "Jpeg" } }
csp-billing-usage: CognitiveServices.ComputerVision.Color=1,CognitiveServices.ComputerVision.Landmarks=1,CognitiveServices.ComputerVision.Transaction=1 x-envoy-upstream-service-time: 3890 apim-request-id: 8e5edb4f-fa4e-4dba-a12e-990a8b903f0c Strict-Transport-Security: max-age=31536000; includeSubDomains; preload x-content-type-options: nosniff Date: Fri, 22 Oct 2021 16:54:09 GMT Content-Length: 420 Content-Type: application/json; charset=utf-8 { "categories": [{ "name": "building_street", "score": 0.40234375, "detail": { "landmarks": [] } }, { "name": "outdoor_", "score": 0.00390625, "detail": { "landmarks": [] } }], "color": { "dominantColorForeground": "Brown", "dominantColorBackground": "White", "dominantColors": ["White"], "accentColor": "753830", "isBwImg": false, "isBWImg": false }, "requestId": "8e5edb4f-fa4e-4dba-a12e-990a8b903f0c", "metadata": { "height": 4224, "width": 5632, "format": "Jpeg" } }
通过上述测试,图像中的基本事物情况已被分析出来。
Request URL
https://picture-analysis.cognitiveservices.azure.cn/vision/v1.0/analyze?visualFeatures=Description&details=Landmarks&language=en
HTTP request
POST https://picture-analysis.cognitiveservices.azure.cn/vision/v1.0/analyze?visualFeatures=Color&details=Landmarks&language=en HTTP/1.1
Host: picture-analysis.cognitiveservices.azure.cn
Content-Type: application/json
Ocp-Apim-Subscription-Key: ••••••••••••••••••••••••••••••••
{"url":"https://i.loli.net/2021/10/23/qwEFXz163lh9duN.jpg"}
{ "categories": [ { "name": "建筑_街道", "score": 0.40234375, "detail": { "landmarks": [] } }, { "name": "户外_", "score": 0.00390625, "detail": { "landmarks": [] } } ], "tags": [ { "name": "天空", "confidence": 0.9999513626098633 }, { "name": "户外", "confidence": 0.9900293350219727 }, { "name": "草", "confidence": 0.9896734952926636 }, { "name": "云", "confidence": 0.9334161281585693 }, { "name": "摩天楼", "confidence": 0.8285492658615112 }, { "name": "建筑", "confidence": 0.8191744089126587 }, { "name": "运动场/游乐场", "confidence": 0.7252355217933655 }, { "name": "运动", "confidence": 0.6510032415390015 }, { "name": "树", "confidence": 0.5010823011398315 }, { "name": "体育场", "confidence": 0.20338237285614014 }, { "name": "天", "confidence": 0.11071398854255676 } ], "description": { "tags": [ "户外", "草", "城市", "大", "体育", "田地", "男人", "站", "球", "绿色", "播放器", "橙子", "公园", "阴天", "空气", "飞行", "轨道", "骑", "飞机", "水", "火车", "街道", "人们", "播放", "院子", "风筝", "蓝色", "巴士" ], "captions": [ { "text": "城市的风景", "confidence": 0.6212207840873964 } ] }, "requestId": "d622f155-d1ff-48b0-8c83-d99efc3d737a", "metadata": { "height": 4224, "width": 5632, "format": "Jpeg" } }
检测和识别图像中的人和情感。
将面部识别嵌入应用中,以实现高度安全的无缝用户体验。不需要掌握机器学习专业知识。功能包括: 人脸检测,可感知图像中的人脸和特性; 人员识别,可以与最多包含 1,000,000 人的专用存储库中的个人进行匹配; 情感识别,可感知各种反应(如快乐、蔑视、中立和恐惧等); 以及对图像中的相似人脸进行识别和分组
参考链接:快速入门:使用人脸客户端库
在线测试链接:[Face API - v1.0](Microsoft Cognitive Services (azure.cn))
[
{
"faceId": "e3aeb060-a895-4687-ace2-117223e4c045",
"faceRectangle": {
"top": 62,
"left": 63,
"width": 57,
"height": 76
}
}
]
若要提取人脸属性,请再次调用检测 API,但将 detectionModel 设置为 detection_01。 同时,添加 returnFaceAttributes 查询参数。 该命令现在应如下所示。 与之前一样,请插入你的人脸订阅密钥和终结点。
[ { "faceId": "3307d715-c326-4c11-98a4-f46ce9ab9ad3", "faceRectangle": { "top": 78, "left": 57, "width": 55, "height": 55 }, "faceAttributes": { "smile": 0.751, "headPose": { "pitch": 7.1, "roll": 7.2, "yaw": -18.3 }, "gender": "female", "age": 22.0, "facialHair": { "moustache": 0.0, "beard": 0.0, "sideburns": 0.0 }, "glasses": "NoGlasses", "emotion": { "anger": 0.0, "contempt": 0.001, "disgust": 0.002, "fear": 0.002, "happiness": 0.751, "neutral": 0.022, "sadness": 0.22, "surprise": 0.001 }, "blur": { "blurLevel": "high", "value": 1.0 }, "exposure": { "exposureLevel": "overExposure", "value": 1.0 }, "noise": { "noiseLevel": "low", "value": 0.0 }, "makeup": { "eyeMakeup": true, "lipMakeup": true }, "accessories": [], "occlusion": { "foreheadOccluded": false, "eyeOccluded": false, "mouthOccluded": false }, "hair": { "bald": 0.05, "invisible": false, "hairColor": [ { "color": "black", "confidence": 1.0 }, { "color": "brown", "confidence": 0.79 }, { "color": "other", "confidence": 0.47 }, { "color": "gray", "confidence": 0.17 }, { "color": "blond", "confidence": 0.07 }, { "color": "red", "confidence": 0.05 }, { "color": "white", "confidence": 0.0 } ] } } } ]
参考链接:Azure认知搜索是什么?
Azure 认知搜索(以前称为“Azure 搜索”)是一个云搜索服务,它为开发人员提供基础结构、API 和工具,用于基于 Web、移动和企业应用程序中的专用异类内容构建丰富的搜索体验。
搜索是任何向用户展示文本内容的应用的基础,其常见方案包括目录或文档搜索、在线零售或数据科学知识挖掘等。
前提条件:
这里选择导入数据源的类型为“示例”。
对于内置的酒店示例索引,系统会为你定义一个默认的索引架构。 除了一些高级筛选器示例之外,针对酒店示例索引的文档和示例中的查询将会根据此索引定义运行:
保持默认,继续下一页操作。
查看索引器。
查看索引。
查看数据源。
参考链接:使用搜索浏览器查询
在“索引”下拉列表中,选择“hotels-sample-index”。 单击“API 版本”下拉列表,查看有哪些 REST API 可用。 对于以下查询,请使用正式发行版 (2020-06-30)。
在搜索栏中粘贴以下查询字符串,并单击“搜索”。
search=beach&$filter=Rating gt 4&$count=true
Seattle apartment "Lake Washington" miele OR thermador appliance
参考链接:查询示例
提供 top N 结果的简单查询
search=spa
筛选查询
分面查询
突出显示搜索结果
试用模糊查询
查实地理空间搜索
参考官方链接:什么是语音服务?
语音服务在单个 Azure 订阅中统合了语音转文本、文本转语音以及语音翻译功能。 使用语音 CLI、语音 SDK、语音设备 SDK、Speech Studio 或 REST API 可以轻松在应用程序、工具和设备中启用语音。
参考链接:语音转文本 REST API
语音转文本有两个不同的 REST API。 每个 API 都有其特殊用途,并使用不同的终结点集。
在 HTTP POST请求的正文中发送音频。 它必须采用下表中的格式之一:
格式 | 编解码器 | 比特率 | 采样率 |
---|---|---|---|
WAV | PCM | 256 kbps | 16 kHz,单声道 |
OGG | OPUS | 256 kpbs | 16 kHz,单声道 |
该表列出了语音转文本请求的必需和可选标头。
标头 | 说明 | 必需/可选 |
---|---|---|
Ocp-Apim-Subscription-Key | 语音服务订阅密钥。 | 此标头或 Authorization 是必需的。 |
Authorization | 前面带有单词Bearer`的授权令牌。 | 此标头或 Ocp-Apim-Subscription-Key是必需的。 |
Pronunciation-Assessment | 指定用于在识别结果中显示发音分数的参数,这些参数评估语音输入的发音质量,并具有准确性、流畅性、完整性等指标。此参数是 Base64 编码的 json,其中包含多个详细的参数。 | 可选 |
Content-type | 描述所提供音频数据的格式和编解码器。 接受的值为 audio/wav; codecs=audio/pcm; samplerate=16000 和 audio/ogg; codecs=opus。 | 必需 |
Transfer-Encoding | 指定要发送分块的音频数据,而不是单个文件。 仅当要对音频数据进行分块时才使用此标头。 | 可选 |
Expect | 如果使用分块传输,则发送 Expect: 100-continue。 语音服务将确认初始请求并等待附加的数据。 | 如果发送分块的音频数据,则是必需的。 |
Accept | 如果提供此标头,则值必须是 application/json。 语音服务以 JSON 格式提供结果。 某些请求框架提供不兼容的默认值。 最好始终包含 Accept。 | 可选,但建议提供。 |
使用Postman获取Token 参考如下:
若要获取访问令牌,需使用 Ocp-Apim-Subscription-Key 和订阅密钥向 issueToken 终结点发出请求。
issueToken 终结点具有以下格式:
https://<REGION_IDENTIFIER>.api.cognitive.azure.cn/sts/v1.0/issueToken
将 <REGION_IDENTIFIER>替换为与下表中的订阅区域匹配的标识符:
地理位置 | 区域 | 区域标识符 |
---|---|---|
中国 | 中国东部 2 | chinaeast2 |
中国 | 中国北部 2 | chinanorth2 |
https://chinaeast2.stt.speech.azure.cn/speech/recognition/conversation/cognitiveservices/v1?initialSilenceTimeoutMs=15000&language=zh-CN
适用于短音频的 REST API 的终结点具有以下格式:
https://<REGION_IDENTIFIER>.stt.speech.azure.cn/speech/recognition/conversation/cognitiveservices/v1
将 <REGION_IDENTIFIER>替换为与下表中的订阅区域匹配的标识符:
地理位置 | 区域 | 区域标识符 |
---|---|---|
中国 | 中国东部 2 | chinaeast2 |
中国 | 中国北部 2 | chinanorth2 |
InitialSilenceTimeout——音频流的开始仅包含静音,并且服务在等待语音时超时。(此标头或 Authorization 是必需的)
language——标识所要识别的口语。(必需)
参考链接:语音转文本入门
参考官方链接:什么是自定义视觉?
Azure 自定义视觉是一种图像识别服务,可用于构建、部署和改进你自己的图像标识符模型。 图像标识符根据其检测到的视觉特征将标签(表示分类或对象)应用于图像。 与计算机视觉服务不同,自定义视觉允许你指定自己的标签并训练自定义模型以对其进行检测。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。