来自Azure Blob存储带有认知服务的呼叫图像的问题
我正在尝试使用Azure认知服务,这给我带来了一个错误:
“ valueError:内容类型无法自动进行自动检测,因为流无法读取/可搜索。请传递content_type关键字参数。 >
我的代码如下:
from azure.core.credentials import AzureKeyCredential
from azure.ai.formrecognizer import FormRecognizerClient
endpoint = "https://example.cognitiveservices.azure.com/"
key = "xxxxxxxxxxxxxxxxxxx820"
read_image_url = 'https://storage-example.blob.core.windows.net/ocr-demo/inputs/IMG_1618.jpg?sp=r&st=2022-06-30xxxxxx31Z&se=2023-0xxxxxx:31Z&spr=https&sv=xxxxx08&sr=b&sig=6xxxxxxxx'
form_recognizer_client = FormRecognizerClient(
endpoint=endpoint, credential=AzureKeyCredential(key)
)
我不明白为什么会返回我,因为我直接从服务和图像中授予密钥。
你能给我任何线索,请给我什么问题?
提前致谢。
问候。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使用认知服务从BLOB存储中调用图像,我们可以实现认知搜索过程。我们需要实现 blob索引器。默认情况下,我们看不到 indexer 在图像上的实现。但是所有图像都将嵌入到 .msg 文件中,并提取文件中的附件。
该提取将返回归一化字段。即使斑点包含图像,也将被忽略,直到我们执行 ai富集。
导入
数据向导
,如下图所述。结帐完整的 indexer 文档
To call image from the blob storage using cognitive services, we can implement Cognitive Search procedure. We need to implement Blob Indexer. By default we can't see implementation of indexer on images. But all the images will be embedded into .MSG file and extract the attachments in the file.
That extraction will return the normalized_images fields. Even though the blob contain images, that will be ignored until the we perform AI enrichment.
Import the
data wizard
like mentioned in the following image.Checkout the complete indexer procedure from document