Cloud Native应用交付

  • 首页
  • 关于本站
  • 个人介绍
  • Downloads
  • Repo
    • Github
    • Container
  • F5
    • F5 Python SDK
    • F5-container
    • F5-LBaaS
  • 社交
    • 联系我
    • 微信/微博
    • 公众号
    • 打赏赞助
行至水穷处 坐看云起时
Cloud Native Application Services: cnadn.net
  1. 首页
  2. AI
  3. 正文

Use Azure cognitive to analyze image

2025年01月22日 1084点热度 0人点赞 0条评论

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from azure.cognitiveservices.vision.computervision.models import VisualFeatureTypes
from msrest.authentication import CognitiveServicesCredentials
import os
 
class colors:
    green = '\033[92m'
    blue = '\033[94m'
    red = '\033[31m'
    yellow = '\033[33m'
    reset = '\033[0m'
 
# Paste your endpoint and key below
cog_endpoint = "Paste_endpoint_here"
cog_key = "Paste_key_here"
computervision_client = ComputerVisionClient(cog_endpoint, CognitiveServicesCredentials(cog_key))
 
 
# Change the URL between the quotes below to run your own images!
image_to_analyze = "https://raw.githubusercontent.com/pluralsight-cloud/AI-900-Artificial-Intelligence-Workloads-and-Considerations/main/images/image-analysis/1-computervision-couple.jpg"
 
 
image_analysis = computervision_client.analyze_image(image_to_analyze,visual_features=[VisualFeatureTypes.description,
VisualFeatureTypes.tags, VisualFeatureTypes.faces])
 
print("\n-----Image Description-----")
for caption in image_analysis.description.captions:
    print(f"{colors.green}Confidence: {colors.reset}" + str(caption.confidence))
    print(f"{colors.green}Description: {colors.reset}" + caption.text)
print("----------\n")
 
 
input("Press Enter to continue to image tags...\n")
 
 
print("-----Image Tags-----")
for tag in image_analysis.tags:
    print(f"{colors.green}Tag:{colors.reset} {tag.name:<15}",
    f" {colors.yellow}Confidence:{colors.reset} {tag.confidence:<15}")
print("----------\n")
 
 
input("Press Enter to continue to face detection...\n")
 
 
print("-----Face Detection-----")
for face in image_analysis.faces:
    print("Face at location {},{},{},{}".format( face.face_rectangle.left, face.face_rectangle.top, \
        face.face_rectangle.left + face.face_rectangle.width, \
        face.face_rectangle.top + face.face_rectangle.height))
print("----------")
 
input("\nPress Enter to Exit...")
 

结果:
-----Image Description-----
Confidence: 0.48432523012161255

Description: a man and woman sitting on a couch with a dog and a cup

Press Enter to continue to image tags...

-----Image Tags-----
Tag: clothing Confidence: 0.9980252385139465
Tag: person Confidence: 0.9966760873794556
Tag: human face Confidence: 0.9829165935516357
Tag: jeans Confidence: 0.9511970281600952
Tag: footwear Confidence: 0.9418420791625977
Tag: jacket Confidence: 0.9413744211196899
Tag: sitting Confidence: 0.9293597936630249
Tag: outdoor Confidence: 0.9179489612579346
Tag: building Confidence: 0.9165546894073486
Tag: man Confidence: 0.9083777070045471
Tag: bench Confidence: 0.8780822157859802
Tag: scarf Confidence: 0.873085618019104
Tag: coat Confidence: 0.8616373538970947
Tag: handbag Confidence: 0.856252908706665
Tag: smile Confidence: 0.8407089710235596
Tag: street Confidence: 0.820195734500885
Tag: woman Confidence: 0.780620813369751
Tag: people Confidence: 0.750357449054718
Tag: ground Confidence: 0.725933313369751

Tag: wooden Confidence: 0.5973995327949524

Press Enter to continue to face detection...

-----Face Detection-----
Face at location 304,161,458,315

Face at location 1565,274,1718,427

相关文章

  • Using Azure cognitive service to do face detection
  • 在Azure ML designer中利用2-class logistic regression做Classification模型
  • 在Azure ML designer中利用线性回归算法训练预测模型
  • Small step in Data and AI- Azure Certificated
  • Use Azure custom vision to do object detection
本作品采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可
标签: azure azure cognitive computer vision
最后更新:2025年01月22日

纳米

linjing.io

打赏 点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

页面AI聊天助手
文章目录
  • Description: a man and woman sitting on a couch with a dog and a cup
  • Tag: wooden Confidence: 0.5973995327949524
  • Face at location 1565,274,1718,427

纳米

linjing.io

☁️迈向Cloud Native ADC ☁️

认证获得:
TOGAF: ID 152743
Kubernetes: CKA #664
Microsoft: MCSE MCDBA
Cisco: CCNP
Juniper: JNCIS
F5:
F5 Certified Solution Expert, Security
F5 Certified Technology Specialist, LTM/GTM/APM/ASM
F5 Certified BIG-IP Administrator
  • 点击查看本博技术要素列表
  • 归档
    分类
    • AI
    • Automation
    • Avi Networks
    • Cisco ACI
    • CISCO资源
    • F5 with ELK
    • F5-Tech tips
    • F5技术
    • Juniper
    • Linux
    • NGINX
    • SDN
    • ServiceMesh
    • WEB编程
    • WINDOWS相关
    • 业界文章
    • 交换机技术
    • 化云为雨/Openstack
    • 协议原理
    • 容器/k8s
    • 我的工作
    • 我的生活
    • 网站技术
    • 路由器技术
    • 项目案例
    标签聚合
    F5 bigip envoy irule k8s flannel api nginx docker istio openstack gtm neutron network DNS
    最近评论
    汤姆 发布于 8 个月前(09月10日) 嗨,楼主,里面的json怎么下载啊,怎么收费啊?
    汤姆 发布于 8 个月前(09月09日) 大佬,kib的页面可以分享下吗?谢谢
    zhangsha 发布于 1 年前(05月12日) 资料发给我下,谢谢纳米同志!!!!lyx895@qq.com
    李成才 发布于 1 年前(01月02日) 麻烦了,谢谢大佬
    纳米 发布于 1 年前(01月02日) 你好。是的,因为以前下载系统插件在一次升级后将所有的下载生成信息全弄丢了。所以不少文件无法下载。DN...
    浏览次数
    • Downloads - 183,754 views
    • 联系我 - 118,966 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 116,431 views
    • Github - 103,633 views
    • F5常见log日志解释 - 79,766 views
    • 从传统ADC迈向CLOUD NATIVE ADC - 下载 - 74,617 views
    • Sniffer Pro 4 70 530抓包软件 中文版+视频教程 - 74,320 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 67,770 views
    • 关于本站 - 60,882 views
    • 这篇文档您是否感兴趣 - 55,491 views
    链接表
    • F5SE创新
    • Jimmy Song‘s Blog
    • SDNlab
    • Service Mesh社区
    • 三斗室
    • 个人profile
    • 云原生社区

    COPYRIGHT © 2023 Cloud Native 应用交付. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    京ICP备14048088号-1

    京公网安备 11010502041506号