详情页标题前

阿里云人工智能平台PAIPAI图像特征提取-云淘科技

详情页1

PAI-EasyVision提供强大的图像特征提取能力,支持多机分布式运行。您通过PAI-EasyVision不仅能够从OSS读取图片,并将图像特征提取结果写回OSS文件,而且能够通过读取表数据获取图片,并将图像特征提取结果写回表中。本文以OSS
IO通路为例,为您介绍图片特征提取过程。

数据格式

请参见输入数据格式。

图像特征提取

基于已有的数据文件列表,您可以通过PAI命令提取图像特征。具体示例如下。

pai -name ev_predict_ext
             -Dmodel_path='oss://pai-vision-data-sh/pretrained_models/saved_models/resnet_v1_50/'
             -Dmodel_type='feature_extractor'
             -Dinput_oss_file='oss://path/to/your/filelist.txt'
             -Doutput_oss_file='oss://path/to/your/result.txt'
             -Dimage_type='url'
             -Dfeature_name='resnet_v1_50/block4'
             -Dnum_worker=2
             -DcpuRequired=800
             -DgpuRequired=100
             -Dbuckets='oss://pai-vision-data-sh/'
             -Darn='your_role_arn'
             -DossHost='oss-cn-shanghai-internal.aliyuncs.com'

详细的参数说明请参见参数说明。

输出结果

结果文件的每行表示一张图片的特征提取结果,由文件路径和JSON字符串组成,示例如下。

oss://path/to/your/image1.jpg,  {"feature": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4583122730255127, 0.0]}
oss://path/to/your/image1.jpg,  {"feature": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4583122730255127, 0.0]}
oss://path/to/your/image1.jpg,  {"feature": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4583122730255127, 0.0]}

其中JSON字符串中仅有一个KV对,feature对应的value表示图像特征,是一个一维向量。

模型地址和模型输出

resnet_v1_50地址:oss://pai-vision-data-sh/pretrained_models/saved_models/resnet_v1_50。输出的模型如下。

resnet_v1_50/block1 shape: [None, 56, 56, 256] type: 
resnet_v1_50/block2 shape: [None, 28, 28, 512] type: 
resnet_v1_50/block3 shape: [None, 14, 14, 1024] type: 
resnet_v1_50/block4 shape: [None, 7, 7, 2048] type: 
AvgPool_1a shape: [None, 1, 1, 2048] type: 
resnet_v1_50/logits shape: [None, 1, 1, 1000] type: 
predictions shape: [None] type: 
class shape: [None] type: 
preprocessed_images shape: [None, 224, 224, 3] type: 
resnet_v1_50/conv1 shape: [None, 112, 112, 64] type: 
logits shape: [None, 1000] type: 
probs shape: [None, 1001] type: 
resnet_v1_50/spatial_squeeze shape: [None, 1000] type: 

resnet_v1_101地址:oss://pai-vision-data-sh/pretrained_models/saved_models/resnet_v1_101。输出的模型如下。

resnet_v1_101/block4 shape: [None, 7, 7, 2048] type: 
resnet_v1_101/logits shape: [None, 1, 1, 1000] type: 
resnet_v1_101/block2 shape: [None, 28, 28, 512] type: 
resnet_v1_101/conv1 shape: [None, 112, 112, 64] type: 
resnet_v1_101/block1 shape: [None, 56, 56, 256] type: 
class shape: [None] type: 
resnet_v1_101/spatial_squeeze shape: [None, 1000] type: 
predictions shape: [None] type: 
preprocessed_images shape: [None, 224, 224, 3] type: 
logits shape: [None, 1000] type: 
resnet_v1_101/block3 shape: [None, 14, 14, 1024] type: 
probs shape: [None, 1001] type: 
AvgPool_1a shape: [None, 1, 1, 2048] type: 

inception_v3地址:oss://pai-vision-data-sh/pretrained_models/saved_models/inception_v3。输出的模型如下。

preprocessed_images shape: [None, 299, 299, 3] type: 
Conv2d_1a_3x3 shape: [None, 149, 149, 32] type: 
Conv2d_2a_3x3 shape: [None, 147, 147, 32] type: 
Conv2d_2b_3x3 shape: [None, 147, 147, 64] type: 
MaxPool_3a_3x3 shape: [None, 73, 73, 64] type: 
Conv2d_3b_1x1 shape: [None, 73, 73, 80] type: 
Conv2d_4a_3x3 shape: [None, 71, 71, 192] type: 
MaxPool_5a_3x3 shape: [None, 35, 35, 192] type: 
Mixed_5b shape: [None, 35, 35, 256] type: 
Mixed_5c shape: [None, 35, 35, 288] type: 
Mixed_5d shape: [None, 35, 35, 288] type: 
Mixed_6a shape: [None, 17, 17, 768] type: 
Mixed_6b shape: [None, 17, 17, 768] type: 
Mixed_6c shape: [None, 17, 17, 768] type: 
Mixed_6d shape: [None, 17, 17, 768] type: 
Mixed_6e shape: [None, 17, 17, 768] type: 
Mixed_7a shape: [None, 8, 8, 1280] type: 
Mixed_7b shape: [None, 8, 8, 2048] type: 
Mixed_7c shape: [None, 8, 8, 2048] type: 
AvgPool_1a shape: [None, 1, 1, 2048] type: 
PreLogits shape: [None, 1, 1, 2048] type: 
Logits shape: [None, 1001] type: 
Predictions shape: [None, 1001] type: 
logits shape: [None, 1001] type: 
probs shape: [None, 1001] type: 
class shape: [None] type: 
predictions shape: [None] type: 
original_image shape: [None, None, None, 3] type: 
original_image_shape shape: [None, 3] type: 

inception_v4地址:oss://pai-vision-data-sh/pretrained_models/saved_models/inception_v4。输出的模型如下。

preprocessed_images shape: [None, 299, 299, 3] type: 
Conv2d_1a_3x3 shape: [None, 149, 149, 32] type: 
Conv2d_2a_3x3 shape: [None, 147, 147, 32] type: 
Conv2d_2b_3x3 shape: [None, 147, 147, 64] type: 
Mixed_3a shape: [None, 73, 73, 160] type: 
Mixed_4a shape: [None, 71, 71, 192] type: 
Mixed_5a shape: [None, 35, 35, 384] type: 
Mixed_5b shape: [None, 35, 35, 384] type: 
Mixed_5c shape: [None, 35, 35, 384] type: 
Mixed_5d shape: [None, 35, 35, 384] type: 
Mixed_5e shape: [None, 35, 35, 384] type: 
Mixed_6a shape: [None, 17, 17, 1024] type: 
Mixed_6b shape: [None, 17, 17, 1024] type: 
Mixed_6c shape: [None, 17, 17, 1024] type: 
Mixed_6d shape: [None, 17, 17, 1024] type: 
Mixed_6e shape: [None, 17, 17, 1024] type: 
Mixed_6f shape: [None, 17, 17, 1024] type: 
Mixed_6g shape: [None, 17, 17, 1024] type: 
Mixed_6h shape: [None, 17, 17, 1024] type: 
Mixed_7a shape: [None, 8, 8, 1536] type: 
Mixed_7b shape: [None, 8, 8, 1536] type: 
Mixed_7c shape: [None, 8, 8, 1536] type: 
Mixed_7d shape: [None, 8, 8, 1536] type: 
AvgPool_1a shape: [None, 1, 1, 1536] type: 
PreLogitsFlatten shape: [None, 1536] type: 
Logits shape: [None, 1001] type: 
Predictions shape: [None, 1001] type: 
logits shape: [None, 1001] type: 
probs shape: [None, 1001] type: 
class shape: [None] type: 
predictions shape: [None] type: 
original_image shape: [None, None, None, 3] type: 
original_image_shape shape: [None, 3] type: 

mobilenet_v2地址:oss://pai-vision-data-sh/pretrained_models/saved_models/mobilenet_v2_1.0_224。输出的模型如下。

preprocessed_images shape: [None, 224, 224, 3] type: 
layer_1 shape: [None, 112, 112, 32] type: 
layer_2 shape: [None, 112, 112, 16] type: 
layer_3 shape: [None, 56, 56, 24] type: 
layer_4 shape: [None, 56, 56, 24] type: 
layer_5 shape: [None, 28, 28, 32] type: 
layer_6 shape: [None, 28, 28, 32] type: 
layer_7 shape: [None, 28, 28, 32] type: 
layer_8 shape: [None, 14, 14, 64] type: 
layer_9 shape: [None, 14, 14, 64] type: 
layer_10 shape: [None, 14, 14, 64] type: 
layer_11 shape: [None, 14, 14, 64] type: 
layer_12 shape: [None, 14, 14, 96] type: 
layer_13 shape: [None, 14, 14, 96] type: 
layer_14 shape: [None, 14, 14, 96] type: 
layer_15 shape: [None, 7, 7, 160] type: 
layer_16 shape: [None, 7, 7, 160] type: 
layer_17 shape: [None, 7, 7, 160] type: 
layer_18 shape: [None, 7, 7, 320] type: 
layer_19 shape: [None, 7, 7, 1280] type: 
layer_2/depthwise_output shape: [None, 112, 112, 32] type: 
layer_2/output shape: [None, 112, 112, 16] type: 
layer_3/expansion_output shape: [None, 112, 112, 96] type: 
layer_3/depthwise_output shape: [None, 56, 56, 96] type: 
layer_3/output shape: [None, 56, 56, 24] type: 
layer_4/expansion_output shape: [None, 56, 56, 144] type: 
layer_4/depthwise_output shape: [None, 56, 56, 144] type: 
layer_4/output shape: [None, 56, 56, 24] type: 
layer_5/expansion_output shape: [None, 56, 56, 144] type: 
layer_5/depthwise_output shape: [None, 28, 28, 144] type: 
layer_5/output shape: [None, 28, 28, 32] type: 
layer_6/expansion_output shape: [None, 28, 28, 192] type: 
layer_6/depthwise_output shape: [None, 28, 28, 192] type: 
layer_6/output shape: [None, 28, 28, 32] type: 
layer_7/expansion_output shape: [None, 28, 28, 192] type: 
layer_7/depthwise_output shape: [None, 28, 28, 192] type: 
layer_7/output shape: [None, 28, 28, 32] type: 
layer_8/expansion_output shape: [None, 28, 28, 192] type: 
layer_8/depthwise_output shape: [None, 14, 14, 192] type: 
layer_8/output shape: [None, 14, 14, 64] type: 
layer_9/expansion_output shape: [None, 14, 14, 384] type: 
layer_9/depthwise_output shape: [None, 14, 14, 384] type: 
layer_9/output shape: [None, 14, 14, 64] type: 
layer_10/expansion_output shape: [None, 14, 14, 384] type: 
layer_10/depthwise_output shape: [None, 14, 14, 384] type: 
layer_10/output shape: [None, 14, 14, 64] type: 
layer_11/expansion_output shape: [None, 14, 14, 384] type: 
layer_11/depthwise_output shape: [None, 14, 14, 384] type: 
layer_11/output shape: [None, 14, 14, 64] type: 
layer_12/expansion_output shape: [None, 14, 14, 384] type: 
layer_12/depthwise_output shape: [None, 14, 14, 384] type: 
layer_12/output shape: [None, 14, 14, 96] type: 
layer_13/expansion_output shape: [None, 14, 14, 576] type: 
layer_13/depthwise_output shape: [None, 14, 14, 576] type: 
layer_13/output shape: [None, 14, 14, 96] type: 
layer_14/expansion_output shape: [None, 14, 14, 576] type: 
layer_14/depthwise_output shape: [None, 14, 14, 576] type: 
layer_14/output shape: [None, 14, 14, 96] type: 
layer_15/expansion_output shape: [None, 14, 14, 576] type: 
layer_15/depthwise_output shape: [None, 7, 7, 576] type: 
layer_15/output shape: [None, 7, 7, 160] type: 
layer_16/expansion_output shape: [None, 7, 7, 960] type: 
layer_16/depthwise_output shape: [None, 7, 7, 960] type: 
layer_16/output shape: [None, 7, 7, 160] type: 
layer_17/expansion_output shape: [None, 7, 7, 960] type: 
layer_17/depthwise_output shape: [None, 7, 7, 960] type: 
layer_17/output shape: [None, 7, 7, 160] type: 
layer_18/expansion_output shape: [None, 7, 7, 960] type: 
layer_18/depthwise_output shape: [None, 7, 7, 960] type: 
layer_18/output shape: [None, 7, 7, 320] type: 
AvgPool_1a shape: [None, 1, 1, 1280] type: 
Logits shape: [None, 1001] type: 
Predictions shape: [None, 1001] type: 
logits shape: [None, 1001] type: 
probs shape: [None, 1001] type: 
class shape: [None] type: 
predictions shape: [None] type: 
original_image shape: [None, None, None, 3] type: 
original_image_shape shape: [None, 3] type: 

efficientnet_b0地址:oss://pai-vision-data-sh/pretrained_models/saved_models/efficientnet-b0。输出的模型如下。

stem shape: [None, 112, 112, 32] type: 
block_0/expansion_output shape: [None, 112, 112, 32] type: 
block_0 shape: [None, 112, 112, 16] type: 
reduction_1/expansion_output shape: [None, 112, 112, 32] type: 
reduction_1 shape: [None, 112, 112, 16] type: 
block_1/expansion_output shape: [None, 56, 56, 96] type: 
block_1 shape: [None, 56, 56, 24] type: 
block_2/expansion_output shape: [None, 56, 56, 144] type: 
block_2 shape: [None, 56, 56, 24] type: 
reduction_2/expansion_output shape: [None, 56, 56, 144] type: 
reduction_2 shape: [None, 56, 56, 24] type: 
block_3/expansion_output shape: [None, 28, 28, 144] type: 
block_3 shape: [None, 28, 28, 40] type: 
block_4/expansion_output shape: [None, 28, 28, 240] type: 
block_4 shape: [None, 28, 28, 40] type: 
reduction_3/expansion_output shape: [None, 28, 28, 240] type: 
reduction_3 shape: [None, 28, 28, 40] type: 
block_5/expansion_output shape: [None, 14, 14, 240] type: 
block_5 shape: [None, 14, 14, 80] type: 
block_6/expansion_output shape: [None, 14, 14, 480] type: 
block_6 shape: [None, 14, 14, 80] type: 
block_7/expansion_output shape: [None, 14, 14, 480] type: 
block_7 shape: [None, 14, 14, 80] type: 
block_8/expansion_output shape: [None, 14, 14, 480] type: 
block_8 shape: [None, 14, 14, 112] type: 
block_9/expansion_output shape: [None, 14, 14, 672] type: 
block_9 shape: [None, 14, 14, 112] type: 
block_10/expansion_output shape: [None, 14, 14, 672] type: 
block_10 shape: [None, 14, 14, 112] type: 
reduction_4/expansion_output shape: [None, 14, 14, 672] type: 
reduction_4 shape: [None, 14, 14, 112] type: 
block_11/expansion_output shape: [None, 7, 7, 672] type: 
block_11 shape: [None, 7, 7, 192] type: 
block_12/expansion_output shape: [None, 7, 7, 1152] type: 
block_12 shape: [None, 7, 7, 192] type: 
block_13/expansion_output shape: [None, 7, 7, 1152] type: 
block_13 shape: [None, 7, 7, 192] type: 
block_14/expansion_output shape: [None, 7, 7, 1152] type: 
block_14 shape: [None, 7, 7, 192] type: 
block_15/expansion_output shape: [None, 7, 7, 1152] type: 
block_15 shape: [None, 7, 7, 320] type: 
reduction_5/expansion_output shape: [None, 7, 7, 1152] type: 
reduction_5 shape: [None, 7, 7, 320] type: 
features shape: [None, 7, 7, 320] type: 
head_1x1 shape: [None, 7, 7, 1280] type: 
pooled_features shape: [None, 1280] type: 
global_pool shape: [None, 1280] type: 
class shape: [None] type: 
head shape: [None, 1000] type: 
logits shape: [None, 1000] type: 
probs shape: [None, 1001] type: 
predictions shape: [None] type: 

内容没看懂? 不太想学习?想快速解决? 有偿解决: 联系专家

阿里云企业补贴进行中: 马上申请

腾讯云限时活动1折起,即将结束: 马上收藏

同尘科技为腾讯云授权服务中心。

购买腾讯云产品享受折上折,更有现金返利:同意关联,立享优惠

转转请注明出处:https://www.yunxiaoer.com/164407.html

(0)
上一篇 2023年12月10日
下一篇 2023年12月10日
详情页2

相关推荐

  • 阿里云对象存储OSS客户端直传概述-云淘科技

    客户端直传是指客户端直接上传文件到对象存储OSS。相对于服务端代理上传,客户端直传避免了业务服务器中转文件,提高了上传速度,节省了服务器资源。本文介绍客户端直传的方案优势、安全实现和实践参考。 为什么客户端直传 在典型的服务端和客户端架构下,常见的文件上传方式是服务端代理上传:客户端将文件上传到业务服务器,然后业务服务器将文件上传到OSS。在这个过程中,一份…

    阿里云对象存储 2023年12月10日
  • 阿里云对象存储OSS通过OSS SDK接入开源生态-云淘科技

    您可以通过OSS SDK接入多种开源生态。 支持通过OSS SDK接入以下多种开源生态: 开源生态 说明 使用Hadoop或者Hive访问OSS 此系列文档由开源软件Apache社区提供。 使用Flink访问OSS 将HBase快照保存在OSS 将Kafka数据导入OSS 此系列文档由面向开源项目的托管平台GitHub提供。 使用Logstash将日志导入O…

    阿里云对象存储 2023年12月10日
  • 阿里云对象存储OSSPython断点续传下载-云淘科技

    当下载大文件时,如果网络不稳定或者程序异常退出,会导致下载失败,甚至重试多次仍无法完成下载。为此,OSS提供了断点续传下载功能。断点续传下载将需要下载的文件分成若干个分片分别下载,所有分片都下载完成后,将所有分片合并成完整的文件。 注意事项 本文以华东1(杭州)外网Endpoint为例。如果您希望通过与OSS同地域的其他阿里云产品访问OSS,请使用内网End…

    阿里云对象存储 2023年12月10日
  • 阿里云对象存储OSSPython进度条-云淘科技

    进度条用于指示上传或下载的进度。 注意事项 本文以华东1(杭州)外网Endpoint为例。如果您希望通过与OSS同地域的其他阿里云产品访问OSS,请使用内网Endpoint。关于OSS支持的Region与Endpoint的对应关系,请参见访问域名和数据中心。 本文以从环境变量读取访问凭证为例。如何配置访问凭证,请参见Python配置访问凭证。 本文以OSS域…

    阿里云对象存储 2023年12月10日
  • 信息流广告,信息流部分建议宽度830px,只针对默认列表样式,顺序随机
  • 阿里云对象存储OSS0033-00000005-云淘科技

    问题描述 请求体XML配置中缺少必选的节点。 问题原因 您发起PutBucketReferer请求配置防盗链,但是请求体XML配置中缺少必选节点RefererList。 问题示例 以下请求体XML配置中缺少必选节点RefererList。 PUT /?referer HTTP/1.1 Date: Fri, 24 Feb 2017 03:15:40 GMT C…

    阿里云对象存储 2023年12月10日

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信
本站为广大会员提供阿里云、腾讯云、华为云、百度云等一线大厂的购买,续费优惠,保证底价,买贵退差。