- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
来自 Azure 计算机视觉
的原始 Read
响应如下所示:
{
"status": "succeeded",
"createdDateTime": "2021-04-08T21:56:17.6819115+00:00",
"lastUpdatedDateTime": "2021-04-08T21:56:18.4161316+00:00",
"analyzeResult": {
"version": "3.2",
"readResults": [
{
"page": 1,
"angle": 0,
"width": 338,
"height": 479,
"unit": "pixel",
"lines": [
{
"boundingBox": [
25,
14
],
"text": "NOTHING",
"appearance": {
"style": {
"name": "other",
"confidence": 0.971
}
},
"words": [
{
"boundingBox": [
27,
15
],
"text": "NOTHING",
"confidence": 0.994
}
]
}
]
}
]
}
}
复制自 here
我想在 Azure 认知搜索
中创建自定义技能
,该技能不使用 VisionSkill
,而是使用我自己的 Azure Functions,该功能将使用 代码中的计算机视觉
客户端。
问题是,将输入传递给 Text.MergeSkill
:
{
"@odata.type": "#Microsoft.Skills.Text.MergeSkill",
"description": "Create merged_text, which includes all the textual representation of each image inserted at the right location in the content field.",
"context": "/document",
"insertPreTag": " ",
"insertPostTag": " ",
"inputs": [
{
"name":"text",
"source": "/document/content"
},
{
"name": "itemsToInsert",
"source": "/document/normalized_images/*/text"
},
{
"name":"offsets",
"source": "/document/normalized_images/*/contentOffset"
}
],
"outputs": [
{
"name": "mergedText",
"targetName" : "merged_text"
}
]
}
我需要将 Read
输出转换为从自定义技能返回 OcrSkill
的形式。该响应必须如下所示:
{
"text": "Hello World. -John",
"layoutText":
{
"language" : "en",
"text" : "Hello World.",
"lines" : [
{
"boundingBox":
[ {"x":10, "y":10}, {"x":50, "y":10}, {"x":50, "y":30},{"x":10, "y":30}],
"text":"Hello World."
},
],
"words": [
{
"boundingBox": [ {"x":110, "y":10}, {"x":150, "y":10}, {"x":150, "y":30},{"x":110, "y":30}],
"text":"Hello"
},
{
"boundingBox": [ {"x":110, "y":10}, {"x":150, "y":10}, {"x":150, "y":30},{"x":110, "y":30}],
"text":"World."
}
]
}
}
我从 here 复制了它
我的问题是,如何从 Read Computer Vision endpoint 转换 boundingBox
参数形成 Text.MergeSkill
接受?我们真的需要这样做吗?还是我们可以将 Read
响应以不同的方式传递给 Text.MergeSkill
?
最佳答案
内置OCRSkill调用某些语言的认知服务计算机视觉读取 API,并通过“文本”输出为您处理文本合并。如果可能的话,我强烈建议您使用这项技能,而不是编写自定义技能。
如果您必须编写自定义技能并自行合并输出文本,请按照the MergeSkill documentation ,“文本”和“偏移”输入是可选的。这意味着,如果您只需要一种将这些输出合并到一个大文本中的方法,您应该能够通过“itemsToInsert”输入直接将文本从各个 Read API 输出对象传递到 MergeSkill。这将使您的技能组看起来像这样(未经测试以确定),假设您仍在使用内置的 AzureSearch 图像提取,并且您的自定义技能输出您上面共享的 Read API 返回的确切负载。
{
"skills": [
{
"@odata.type": "#Microsoft.Skills.Custom.WebApiSkill",
"description": "Custom skill that calls Cognitive Services Computer Vision Read API",
"uri": "<your custom skill uri>",
"batchSize": 1,
"context": "/document/normalized_images/*",
"inputs": [
{
"name": "image",
"source": "/document/normalized_images/*"
}
],
"outputs": [
{
"name": "readAPIOutput"
}
]
},
{
"@odata.type": "#Microsoft.Skills.Text.MergeSkill",
"description": "Create merged_text, which includes all the textual representation of each image inserted at the right location in the content field.",
"context": "/document",
"insertPreTag": "",
"insertPostTag": "\n",
"inputs": [
{
"name": "itemsToInsert",
"source": "/document/normalized_images/*/readAPIOutput/analyzeResult/readResults/*/lines/*/text"
}
],
"outputs": [
{
"name": "mergedText",
"targetName": "merged_text"
}
]
}
]
}
但是,如果您需要保证文本根据边界框以正确的顺序显示,您可能需要编写一个自定义解决方案来计算位置并自行重新组合文本。因此,如果可能的话,建议在 OCRSkill 中使用我们的内置解决方案。
关于azure - 将 Azure 计算机视觉读取响应转换为 Azure 认知搜索中相关的 MergeText 技能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72531773/
使用 Cognito 的 forgotPassword 函数时,如果我尝试运行忘记密码方法超过 5 次,我会收到“LimitExceededException”错误。 此时是否有关于此的进一步文档?
我正在尝试向 Azure 的认知文本分析提供一些简单的、Hello-Worldish 的 JSON 示例;使用此测试数据: { "documents": [ { "lan
我正在尝试向 Azure 的认知文本分析提供一些简单的、Hello-Worldish 的 JSON 示例;使用此测试数据: { "documents": [ { "lan
我无法获得我的 CognitoIdentity 的凭据。当用户通过身份验证成功后,他需要获得一个身份才能访问其他 AWS 服务。在我的例子中就是 AWS IoT。但不知何故,我无法获得任何凭证。 这是
我正在使用 aws lambdas、dynamodb 和 cognito 构建身份验证系统。 我一直在比较 getOpenIdTokenForDeveloperIdentity() 提供的 token
我在 Cognito 中单击了“重置密码”,现在登录时出现“PasswordResetRequiredException”,我该如何处理?我在文档中找不到任何内容告诉我应该怎么做? 最佳答案 检查这个
我正在使用 Azure 认知服务,更准确地说是“bing 图像搜索服务”。我发送请求以获取与特定关键字相关的图像。 为此,我向正确的 Azure 端点发出 HTTP REST 请求: 'https:/
我正在使用 Azure 认知服务,更准确地说是“bing 图像搜索服务”。我发送请求以获取与特定关键字相关的图像。 为此,我向正确的 Azure 端点发出 HTTP REST 请求: 'https:/
如果用户登录,我会检查用户是否有 IoT 所需的策略,如果没有,我会附加它。 如果我是第一次登录,这很好用。 现在,当我注销并尝试使用不同的用户登录时,由于某种原因缺少凭据,当我刷新页面时,它再次工作
我将使用 Express 制作的 API 与 API Gateway 封装在一起。我正在使用 Cognito Userpool 来验证 API Gateway。 当我使用 Angular2 http
目前,每次重新启动应用程序时,用户都必须登录。我希望应用程序能够记住用户,直到他们手动注销。以下是我认为可行的方法,但它只是完全绕过了登录 Activity 。 @Override protected
想知道,如何识别图像是否包含特定对象并且该对象完全可见(而不是部分可见)。 Cognitive Services Computer Vision API提供了一组标签和我发送的图像的描述,但是,没有信
用例如下 我们的系统中有面孔列表 用户将上传一张图片 我们希望显示与上传图像匹配的面孔列表,例如置信度 >0.8 现在查看how to ,我的理解如下 使用人脸检测API,我们需要首先上传所有图像,包
用例如下 我们的系统中有面孔列表 用户将上传一张图片 我们希望显示与上传图像匹配的面孔列表,例如置信度 >0.8 现在查看how to ,我的理解如下 使用人脸检测API,我们需要首先上传所有图像,包
上下文 我使用 booth Cognito 用户池和 Cognito 身份池来登录用户。 我想完成一个简单的任务,让用户在 iOS 应用程序(Swift 应用程序)上登录。 我的应用程序基于自定义版本
我在捕获 Cognito 注册错误时遇到困难。当 Cognito 返回“UsernameExistsException”、“message”:“User already exists”错误时,我试图提
我正在试验 Cognito,当我认为它开始没问题时,我遇到了 (Google) token 在 1 小时后过期的问题。 当我开始使用干净的设备时,我可以注册并使用该应用程序 1 小时,然后当我需要刷新
我正在使用 AWS Cognito ( http://docs.aws.amazon.com/cognito/latest/developerguide/using-amazon-cognito-us
是否有办法防止云形成更新删除或重新创建 Cognito 用户池资源?我想消除这种情况发生的可能性。有办法吗? 最佳答案 我找到了答案。使用删除策略。适用于任何 Cloud Formation 资源:
我正在调用 Azure 认知 API 进行 OCR 文本识别,并且同时传递 10 个图像(因为下面的代码一次只接受一个图像 - 即 10 个独立的请求并行),从处理的角度来看,这对我来说效率不高,因为
我是一名优秀的程序员,十分优秀!