物价性比下降 计算研究人脸检测并面部识别算法快速扩展,新技术提高精度并缩短处理时间
人脸检测技术识别数字图像中人脸是否和在哪里常用相机 安全应用 图形应用 各种网络移动应用这也是人脸识别的先决条件,它使用数据库和附加算法匹配检测到人脸与具体个人
大部分网站应用中大百分比图像包含人相片从剖面图片新闻文章到自拍组照片需要显示大小、形状和样式与网站设计匹配自动面部裁剪或程序化修改图像包含面部需要可靠的面部检测技术可靠性可能受颜色或图像缺少颜色、人面向方向、头部倾斜、脸尺寸、背景复杂性、光线等影响
云化为Web和移动应用程序员提供全图象视频管理解决方案我们的解决方案包括内置图像脸部检测功能和数个面部检测特征可自用应用在大多数情况下,应用此功能只是一个问题 添加一或二
云化最近更新面部检测技术新技术现时高效精确包括许多困难假想,如侧画像、模糊脸孔、难点亮等
光线低、影影异常、黑白图像变换头目和闭目等都很容易检测到这些图像中的人
交付图像URL时,包括面部检测变换,原照片中面部即时检测,请求变换在云中执行,最后图像通过CDN交付
博客其余部分将覆盖开发者可自动变换专有用户生成照片以适应网站或a
最常用的面部检测方法之一是裁剪大比例图像,尤其是用户生成内容中包含人相片
头像对图片、聊天头像和更多图片都有必要,但原版上传照片可能包含远不止一张脸,表情甚至可能不是照片中的核心元素。组自定义也很受欢迎 很少居中 所以再次 我们需要非常小心
简言之,在多数情况下关键是 当我们调整尺寸并裁剪上传照片时, 我们保留用户面部前端居中有各种特征可以使用或合并以确保这一点
裁剪图片用于剖面图片或其他头像时,通常都想使用脸部
和裁剪重力
高山市g_face
内URLs)保证检测到脸部(或最大脸部多图一)为裁剪照片中心,
结合使用脸部
重力使用缩略图
as your裁剪
方法上,你将获得尽可能紧凑(裁剪维度)到检测到面坐标的作物
设置缩略图裁剪缩放
值缩放或调出检测到的面坐标并随后可添加任何其他变换
发件代码像上一张照片
<\/Image>","codeSnippet":"
\n\t
\n\t
\n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"teen_facedown\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .adjust(improve())\n .effect(shadow());","codeSnippet":"new CloudinaryImage(\"teen_facedown\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .adjust(improve())\n .effect(shadow());","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":"
<\/cld-image>","codeSnippet":"
\n\t
\n\t
\n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"teen_facedown\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .adjust(improve())\n .effect(shadow());","codeSnippet":"new CloudinaryImage(\"teen_facedown\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .adjust(improve())\n .effect(shadow());","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":"
<\/cl-transformation>
<\/cl-transformation> <\/cl-image>","codeSnippet":"
\n\t
\n\t<\/cl-transformation>\n\t
\n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"teen_facedown\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .adjust(improve())\n .effect(shadow());","codeSnippet":"new CloudinaryImage(\"teen_facedown\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .adjust(improve())\n .effect(shadow());","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('teen_facedown', {transformation: [ {width: 200, height: 200, gravity: \"face\", zoom: \"0.65\", radius: \"max\", effect: \"improve\", crop: \"thumb\"}, {effect: \"shadow\"} ]}).toHtml();","codeSnippet":"cloudinary.imageTag('teen_facedown', {transformation: [\n {width: 200, height: 200, gravity: \"face\", zoom: \"0.65\", radius: \"max\", effect: \"improve\", crop: \"thumb\"},\n {effect: \"shadow\"}\n ]}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"teen_facedown\").image(transformation=[ {'width': 200, 'height': 200, 'gravity': \"face\", 'zoom': \"0.65\", 'radius': \"max\", 'effect': \"improve\", 'crop': \"thumb\"}, {'effect': \"shadow\"} ])","codeSnippet":"CloudinaryImage(\"teen_facedown\").image(transformation=[\n {'width': 200, 'height': 200, 'gravity': \"face\", 'zoom': \"0.65\", 'radius': \"max\", 'effect': \"improve\", 'crop': \"thumb\"},\n {'effect': \"shadow\"}\n ])","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('teen_facedown'))\n\t->resize(Resize::thumbnail()->width(200)\n->height(200)\n->zoom(0.65)\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::face()))\n\t)\n\t->roundCorners(RoundCorners::max())\n\t->adjust(Adjust::improve())\n\t->effect(Effect::shadow());","codeSnippet":"(new ImageTag('teen_facedown'))\n\t->resize(Resize::thumbnail()->width(200)\n->height(200)\n->zoom(0.65)\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::face()))\n\t)\n\t->roundCorners(RoundCorners::max())\n\t->adjust(Adjust::improve())\n\t->effect(Effect::shadow());","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"teen_facedown\", array(\"transformation\"=>array( array(\"width\"=>200, \"height\"=>200, \"gravity\"=>\"face\", \"zoom\"=>\"0.65\", \"radius\"=>\"max\", \"effect\"=>\"improve\", \"crop\"=>\"thumb\"), array(\"effect\"=>\"shadow\") )))","codeSnippet":"cl_image_tag(\"teen_facedown\", array(\"transformation\"=>array(\n array(\"width\"=>200, \"height\"=>200, \"gravity\"=>\"face\", \"zoom\"=>\"0.65\", \"radius\"=>\"max\", \"effect\"=>\"improve\", \"crop\"=>\"thumb\"),\n array(\"effect\"=>\"shadow\")\n )))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().width(200).height(200).gravity(\"face\").zoom(0.65).radius(\"max\").effect(\"improve\").crop(\"thumb\").chain() .effect(\"shadow\")).imageTag(\"teen_facedown\");","codeSnippet":"cloudinary.url().transformation(new Transformation()\n .width(200).height(200).gravity(\"face\").zoom(0.65).radius(\"max\").effect(\"improve\").crop(\"thumb\").chain()\n .effect(\"shadow\")).imageTag(\"teen_facedown\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"teen_facedown\", :transformation=>[ {:width=>200, :height=>200, :gravity=>\"face\", :zoom=>0.65, :radius=>\"max\", :effect=>\"improve\", :crop=>\"thumb\"}, {:effect=>\"shadow\"} ])","codeSnippet":"cl_image_tag(\"teen_facedown\", :transformation=>[\n {:width=>200, :height=>200, :gravity=>\"face\", :zoom=>0.65, :radius=>\"max\", :effect=>\"improve\", :crop=>\"thumb\"},\n {:effect=>\"shadow\"}\n ])","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(200).Height(200).Gravity(\"face\").Zoom(0.65).Radius(\"max\").Effect(\"improve\").Crop(\"thumb\").Chain() .Effect(\"shadow\")).BuildImageTag(\"teen_facedown\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation()\n .Width(200).Height(200).Gravity(\"face\").Zoom(0.65).Radius(\"max\").Effect(\"improve\").Crop(\"thumb\").Chain()\n .Effect(\"shadow\")).BuildImageTag(\"teen_facedown\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('teen_facedown').transformation(Transformation()\n\t.resize(Resize.thumbnail().width(200)\n.height(200)\n.zoom(0.65)\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t)\n\t.roundCorners(RoundCorners.max())\n\t.adjust(Adjust.improve())\n\t.effect(Effect.shadow()));","codeSnippet":"cloudinary.image('teen_facedown').transformation(Transformation()\n\t.resize(Resize.thumbnail().width(200)\n.height(200)\n.zoom(0.65)\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t)\n\t.roundCorners(RoundCorners.max())\n\t.adjust(Adjust.improve())\n\t.effect(Effect.shadow()));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setWidth(200).setHeight(200).setGravity(\"face\").setZoom(0.65).setRadius(\"max\").setEffect(\"improve\").setCrop(\"thumb\").chain() .setEffect(\"shadow\")).generate(\"teen_facedown\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()\n .setWidth(200).setHeight(200).setGravity(\"face\").setZoom(0.65).setRadius(\"max\").setEffect(\"improve\").setCrop(\"thumb\").chain()\n .setEffect(\"shadow\")).generate(\"teen_facedown\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().width(200).height(200).gravity(\"face\").zoom(0.65).radius(\"max\").effect(\"improve\").crop(\"thumb\").chain() .effect(\"shadow\")).generate(\"teen_facedown\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation()\n .width(200).height(200).gravity(\"face\").zoom(0.65).radius(\"max\").effect(\"improve\").crop(\"thumb\").chain()\n .effect(\"shadow\")).generate(\"teen_facedown\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('teen_facedown').transformation(Transformation()\n\t.addTransformation(\"w_200,h_200,g_face,c_thumb,z_0.65,r_max,e_improve\/e_shadow\"));","codeSnippet":"cloudinary.image('teen_facedown').transformation(Transformation()\n\t.addTransformation(\"w_200,h_200,g_face,c_thumb,z_0.65,r_max,e_improve\/e_shadow\"));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"teen_facedown\")\n\t resize(Resize.thumbnail() { width(200)\n height(200)\n zoom(0.65F)\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t })\n\t roundCorners(RoundCorners.max())\n\t adjust(Adjust.improve())\n\t effect(Effect.shadow()) \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"teen_facedown\")\n\t resize(Resize.thumbnail() { width(200)\n height(200)\n zoom(0.65F)\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t })\n\t roundCorners(RoundCorners.max())\n\t adjust(Adjust.improve())\n\t effect(Effect.shadow()) \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"teen_facedown\", {transformation: [ {width: 200, height: 200, gravity: \"face\", zoom: \"0.65\", radius: \"max\", effect: \"improve\", crop: \"thumb\"}, {effect: \"shadow\"} ]})","codeSnippet":"$.cloudinary.image(\"teen_facedown\", {transformation: [\n {width: 200, height: 200, gravity: \"face\", zoom: \"0.65\", radius: \"max\", effect: \"improve\", crop: \"thumb\"},\n {effect: \"shadow\"}\n ]})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"teen_facedown\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .adjust(improve())\n .effect(shadow());","codeSnippet":"new CloudinaryImage(\"teen_facedown\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .adjust(improve())\n .effect(shadow());","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.agrosoland.com\/demo\/image\/upload\/w_200,h_200,g_face,c_thumb,z_0.65,r_max,e_improve\/e_shadow\/teen_facedown","cloud_name":"demo","host":"res.www.agrosoland.com","type":"upload","resource_type":"image","transformation":[{"width":"200","height":"200","gravity":"face","crop_mode":"thumb","zoom":"0.65","radius":"max","effect":"improve"},{"effect":"shadow"}],"transformation_string":"w_200,h_200,g_face,c_thumb,z_0.65,r_max,e_improve\/e_shadow","url_suffix":"","version":"","secure":true,"public_id":"teen_facedown","extension":"","format":"","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" >
加载代码示例
以上提到的一切对多面同样有效公用脸部
重力代之以脸部
内含所有检测到面孔的矩形
以上所有假设都可合理预期上传图像将包含一面或多面主体
有时图像主体不一定期望为人, 但你仍然需要确保你不是切除人或图像其他重要内容在这种情况下,你可以利用汽车
重力特征使用自动化裁剪法 图片中最突出元素决定裁剪坐标除另有说明外,任何检测脸部
获取高优先级 裁剪决策, 并包含其他突出元素
多学多学汽车
重力在此博客文章和这个文档记录.
可能有些事你想把人 贴上匿名照片在这些例子中,通过向图像URL添加单参数即可像素或模糊所有检测到的面孔
以下文为例,云式音乐会听众所检测的面孔通常是那些可能被人查看者识别的面孔。使用图像传送前所有这些表情都自动模糊模糊面孔
效果
<\/Image>","codeSnippet":"
\n\t
\n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"concert_crowd\").effect(\n blur()\n .strength(500)\n .region(faces())\n);","codeSnippet":"new CloudinaryImage(\"concert_crowd\").effect(\n blur()\n .strength(500)\n .region(faces())\n);","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":"
<\/cld-image>","codeSnippet":"
\n\t
\n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"concert_crowd\").effect(\n blur()\n .strength(500)\n .region(faces())\n);","codeSnippet":"new CloudinaryImage(\"concert_crowd\").effect(\n blur()\n .strength(500)\n .region(faces())\n);","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":"
<\/cl-transformation> <\/cl-image>","codeSnippet":"
\n\t
\n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"concert_crowd\").effect(\n blur()\n .strength(500)\n .region(faces())\n);","codeSnippet":"new CloudinaryImage(\"concert_crowd\").effect(\n blur()\n .strength(500)\n .region(faces())\n);","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('concert_crowd', {effect: \"blur_faces:500\"}).toHtml();","codeSnippet":"cloudinary.imageTag('concert_crowd', {effect: \"blur_faces:500\"}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"concert_crowd\").image(effect=\"blur_faces:500\")","codeSnippet":"CloudinaryImage(\"concert_crowd\").image(effect=\"blur_faces:500\")","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('concert_crowd'))\n\t->effect(Effect::blur()->strength(500)\n\t->region(\n\tRegion::faces())\n\t);","codeSnippet":"(new ImageTag('concert_crowd'))\n\t->effect(Effect::blur()->strength(500)\n\t->region(\n\tRegion::faces())\n\t);","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"concert_crowd\", array(\"effect\"=>\"blur_faces:500\"))","codeSnippet":"cl_image_tag(\"concert_crowd\", array(\"effect\"=>\"blur_faces:500\"))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().effect(\"blur_faces:500\")).imageTag(\"concert_crowd\");","codeSnippet":"cloudinary.url().transformation(new Transformation().effect(\"blur_faces:500\")).imageTag(\"concert_crowd\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"concert_crowd\", :effect=>\"blur_faces:500\")","codeSnippet":"cl_image_tag(\"concert_crowd\", :effect=>\"blur_faces:500\")","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Effect(\"blur_faces:500\")).BuildImageTag(\"concert_crowd\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Effect(\"blur_faces:500\")).BuildImageTag(\"concert_crowd\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('concert_crowd').transformation(Transformation()\n\t.effect(Effect.blur().strength(500)\n\t.region(\n\tRegion.faces())\n\t));","codeSnippet":"cloudinary.image('concert_crowd').transformation(Transformation()\n\t.effect(Effect.blur().strength(500)\n\t.region(\n\tRegion.faces())\n\t));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setEffect(\"blur_faces:500\")).generate(\"concert_crowd\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setEffect(\"blur_faces:500\")).generate(\"concert_crowd\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().effect(\"blur_faces:500\")).generate(\"concert_crowd\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation().effect(\"blur_faces:500\")).generate(\"concert_crowd\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('concert_crowd').transformation(Transformation()\n\t.effect(Effect.blur().strength(500)\n\t.region(\n\tRegion.faces())\n\t));","codeSnippet":"cloudinary.image('concert_crowd').transformation(Transformation()\n\t.effect(Effect.blur().strength(500)\n\t.region(\n\tRegion.faces())\n\t));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"concert_crowd\")\n\t effect(Effect.blur() { strength(500)\n\t region(\n\tRegion.faces())\n\t }) \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"concert_crowd\")\n\t effect(Effect.blur() { strength(500)\n\t region(\n\tRegion.faces())\n\t }) \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"concert_crowd\", {effect: \"blur_faces:500\"})","codeSnippet":"$.cloudinary.image(\"concert_crowd\", {effect: \"blur_faces:500\"})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"concert_crowd\").effect(\n blur()\n .strength(500)\n .region(faces())\n);","codeSnippet":"new CloudinaryImage(\"concert_crowd\").effect(\n blur()\n .strength(500)\n .region(faces())\n);","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.agrosoland.com\/demo\/image\/upload\/e_blur_faces:500\/concert_crowd","cloud_name":"demo","host":"res.www.agrosoland.com","type":"upload","resource_type":"image","transformation":[{"effect":"blur_faces:500"}],"transformation_string":"e_blur_faces:500","url_suffix":"","version":"","secure":true,"public_id":"concert_crowd","extension":"","format":"","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" >
加载代码示例
举冰滑场景为例 孩子们的脸清晰可见使用像素选项保护孩子们身份
<\/Image>","codeSnippet":"
\n\t
\n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"ice_skating.jpg\")\n .effect(\n pixelate()\n .squareSize(4)\n .region(faces().width(500))\n )\n .resize(scale());","codeSnippet":"new CloudinaryImage(\"ice_skating.jpg\")\n .effect(\n pixelate()\n .squareSize(4)\n .region(faces().width(500))\n )\n .resize(scale());","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":"
<\/cld-image>","codeSnippet":"
\n\t
\n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"ice_skating.jpg\")\n .effect(\n pixelate()\n .squareSize(4)\n .region(faces().width(500))\n )\n .resize(scale());","codeSnippet":"new CloudinaryImage(\"ice_skating.jpg\")\n .effect(\n pixelate()\n .squareSize(4)\n .region(faces().width(500))\n )\n .resize(scale());","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":"
<\/cl-transformation> <\/cl-image>","codeSnippet":"
\n\t
\n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"ice_skating.jpg\")\n .effect(\n pixelate()\n .squareSize(4)\n .region(faces().width(500))\n )\n .resize(scale());","codeSnippet":"new CloudinaryImage(\"ice_skating.jpg\")\n .effect(\n pixelate()\n .squareSize(4)\n .region(faces().width(500))\n )\n .resize(scale());","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('ice_skating.jpg', {effect: \"pixelate_faces:4\", width: 500, crop: \"scale\"}).toHtml();","codeSnippet":"cloudinary.imageTag('ice_skating.jpg', {effect: \"pixelate_faces:4\", width: 500, crop: \"scale\"}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"ice_skating.jpg\").image(effect=\"pixelate_faces:4\", width=500, crop=\"scale\")","codeSnippet":"CloudinaryImage(\"ice_skating.jpg\").image(effect=\"pixelate_faces:4\", width=500, crop=\"scale\")","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('ice_skating.jpg'))\n\t->effect(Effect::pixelate()->squareSize(4)\n\t->region(\n\tRegion::faces()->width(500))\n\t)\n\t->resize(Resize::scale());","codeSnippet":"(new ImageTag('ice_skating.jpg'))\n\t->effect(Effect::pixelate()->squareSize(4)\n\t->region(\n\tRegion::faces()->width(500))\n\t)\n\t->resize(Resize::scale());","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"ice_skating.jpg\", array(\"effect\"=>\"pixelate_faces:4\", \"width\"=>500, \"crop\"=>\"scale\"))","codeSnippet":"cl_image_tag(\"ice_skating.jpg\", array(\"effect\"=>\"pixelate_faces:4\", \"width\"=>500, \"crop\"=>\"scale\"))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().effect(\"pixelate_faces:4\").width(500).crop(\"scale\")).imageTag(\"ice_skating.jpg\");","codeSnippet":"cloudinary.url().transformation(new Transformation().effect(\"pixelate_faces:4\").width(500).crop(\"scale\")).imageTag(\"ice_skating.jpg\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"ice_skating.jpg\", :effect=>\"pixelate_faces:4\", :width=>500, :crop=>\"scale\")","codeSnippet":"cl_image_tag(\"ice_skating.jpg\", :effect=>\"pixelate_faces:4\", :width=>500, :crop=>\"scale\")","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Effect(\"pixelate_faces:4\").Width(500).Crop(\"scale\")).BuildImageTag(\"ice_skating.jpg\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Effect(\"pixelate_faces:4\").Width(500).Crop(\"scale\")).BuildImageTag(\"ice_skating.jpg\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('ice_skating.jpg').transformation(Transformation()\n\t.effect(Effect.pixelate().squareSize(4)\n\t.region(\n\tRegion.faces().width(500))\n\t)\n\t.resize(Resize.scale()));","codeSnippet":"cloudinary.image('ice_skating.jpg').transformation(Transformation()\n\t.effect(Effect.pixelate().squareSize(4)\n\t.region(\n\tRegion.faces().width(500))\n\t)\n\t.resize(Resize.scale()));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setEffect(\"pixelate_faces:4\").setWidth(500).setCrop(\"scale\")).generate(\"ice_skating.jpg\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setEffect(\"pixelate_faces:4\").setWidth(500).setCrop(\"scale\")).generate(\"ice_skating.jpg\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().effect(\"pixelate_faces:4\").width(500).crop(\"scale\")).generate(\"ice_skating.jpg\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation().effect(\"pixelate_faces:4\").width(500).crop(\"scale\")).generate(\"ice_skating.jpg\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('ice_skating.jpg').transformation(Transformation()\n\t.effect(Effect.pixelate().squareSize(4)\n\t.region(\n\tRegion.faces().width(500))\n\t)\n\t.resize(Resize.scale()));","codeSnippet":"cloudinary.image('ice_skating.jpg').transformation(Transformation()\n\t.effect(Effect.pixelate().squareSize(4)\n\t.region(\n\tRegion.faces().width(500))\n\t)\n\t.resize(Resize.scale()));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"ice_skating.jpg\")\n\t effect(Effect.pixelate() { squareSize(4)\n\t region(\n\tRegion.faces() { width(500) })\n\t })\n\t resize(Resize.scale()) \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"ice_skating.jpg\")\n\t effect(Effect.pixelate() { squareSize(4)\n\t region(\n\tRegion.faces() { width(500) })\n\t })\n\t resize(Resize.scale()) \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"ice_skating.jpg\", {effect: \"pixelate_faces:4\", width: 500, crop: \"scale\"})","codeSnippet":"$.cloudinary.image(\"ice_skating.jpg\", {effect: \"pixelate_faces:4\", width: 500, crop: \"scale\"})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"ice_skating.jpg\")\n .effect(\n pixelate()\n .squareSize(4)\n .region(faces().width(500))\n )\n .resize(scale());","codeSnippet":"new CloudinaryImage(\"ice_skating.jpg\")\n .effect(\n pixelate()\n .squareSize(4)\n .region(faces().width(500))\n )\n .resize(scale());","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.agrosoland.com\/demo\/image\/upload\/c_scale,e_pixelate_faces:4,w_500\/ice_skating.jpg","cloud_name":"demo","host":"res.www.agrosoland.com","type":"upload","resource_type":"image","transformation":[{"crop_mode":"scale","effect":"pixelate_faces:4","width":"500"}],"transformation_string":"c_scale,e_pixelate_faces:4,w_500","url_suffix":"","version":"","secure":true,"public_id":"ice_skating.jpg","extension":"jpg","format":"jpg","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" >
加载代码示例
小技巧:对于类似案例,你可能想利用其中之一访问控制选项禁止用户访问非卷发或非分解图像版本
没有什么像面部检测技术 将检测100%面部 百分百时间,没问题常可明文更新检测到的坐标
举个例子,当用户上传图像到网站时,你可检索并显示检测到的脸坐标,然后帮助用户调整坐标或通过UI添加新面孔接二连三地传送更新坐标更新odminAPI方法
面向自己的图片,您也可以使用Media库UI手动修改坐标
有时,光模糊或仿相是不够的取而代之的是,你想要用另一图像完全覆盖脸部或,也许你只是想加个趣味面罩不论原因为何 相片中所有面部都添加同一张图像很简单
要做到这一点,你利用区域相对性
标志和标志脸部
重力指针叠加图像向云形表示,你希望把叠加放到所有表情上, 并说每个叠加指定大小相对于每个检测到脸孔大小的百分比
举个例子,这里快速方式 令你的家人穿戴服装
<\/Image>","codeSnippet":"
\n\t
\n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"family_portrait.jpg\").overlay(\n source(\n image(\"spiderman_mask\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(new Position().gravity(focusOn(faces())))\n);","codeSnippet":"new CloudinaryImage(\"family_portrait.jpg\").overlay(\n source(\n image(\"spiderman_mask\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(new Position().gravity(focusOn(faces())))\n);","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":"
<\/cld-image>","codeSnippet":"
\n\t
\n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"family_portrait.jpg\").overlay(\n source(\n image(\"spiderman_mask\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(new Position().gravity(focusOn(faces())))\n);","codeSnippet":"new CloudinaryImage(\"family_portrait.jpg\").overlay(\n source(\n image(\"spiderman_mask\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(new Position().gravity(focusOn(faces())))\n);","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":"
<\/cl-transformation> <\/cl-image>","codeSnippet":"
\n\t
\n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"family_portrait.jpg\").overlay(\n source(\n image(\"spiderman_mask\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(new Position().gravity(focusOn(faces())))\n);","codeSnippet":"new CloudinaryImage(\"family_portrait.jpg\").overlay(\n source(\n image(\"spiderman_mask\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(new Position().gravity(focusOn(faces())))\n);","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('family_portrait.jpg', {gravity: \"faces\", overlay: new cloudinary.Layer().publicId(\"spiderman_mask\"), width: \"1.1\", flags: \"region_relative\"}).toHtml();","codeSnippet":"cloudinary.imageTag('family_portrait.jpg', {gravity: \"faces\", overlay: new cloudinary.Layer().publicId(\"spiderman_mask\"), width: \"1.1\", flags: \"region_relative\"}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"family_portrait.jpg\").image(gravity=\"faces\", overlay=\"spiderman_mask\", width=\"1.1\", flags=\"region_relative\")","codeSnippet":"CloudinaryImage(\"family_portrait.jpg\").image(gravity=\"faces\", overlay=\"spiderman_mask\", width=\"1.1\", flags=\"region_relative\")","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('family_portrait.jpg'))\n\t->overlay(Overlay::source(\n\tSource::image(\"spiderman_mask\")\n\t->transformation((new Transformation())\n\t->resize(Resize::scale()->width(1.1)\n\t->regionRelative()\n\t))\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::faces()))\n\t)\n\t);","codeSnippet":"(new ImageTag('family_portrait.jpg'))\n\t->overlay(Overlay::source(\n\tSource::image(\"spiderman_mask\")\n\t->transformation((new Transformation())\n\t->resize(Resize::scale()->width(1.1)\n\t->regionRelative()\n\t))\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::faces()))\n\t)\n\t);","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"family_portrait.jpg\", array(\"gravity\"=>\"faces\", \"overlay\"=>\"spiderman_mask\", \"width\"=>\"1.1\", \"flags\"=>\"region_relative\"))","codeSnippet":"cl_image_tag(\"family_portrait.jpg\", array(\"gravity\"=>\"faces\", \"overlay\"=>\"spiderman_mask\", \"width\"=>\"1.1\", \"flags\"=>\"region_relative\"))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().gravity(\"faces\").overlay(new Layer().publicId(\"spiderman_mask\")).width(1.1).flags(\"region_relative\")).imageTag(\"family_portrait.jpg\");","codeSnippet":"cloudinary.url().transformation(new Transformation().gravity(\"faces\").overlay(new Layer().publicId(\"spiderman_mask\")).width(1.1).flags(\"region_relative\")).imageTag(\"family_portrait.jpg\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"family_portrait.jpg\", :gravity=>\"faces\", :overlay=>\"spiderman_mask\", :width=>1.1, :flags=>\"region_relative\")","codeSnippet":"cl_image_tag(\"family_portrait.jpg\", :gravity=>\"faces\", :overlay=>\"spiderman_mask\", :width=>1.1, :flags=>\"region_relative\")","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Gravity(\"faces\").Overlay(new Layer().PublicId(\"spiderman_mask\")).Width(1.1).Flags(\"region_relative\")).BuildImageTag(\"family_portrait.jpg\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Gravity(\"faces\").Overlay(new Layer().PublicId(\"spiderman_mask\")).Width(1.1).Flags(\"region_relative\")).BuildImageTag(\"family_portrait.jpg\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('family_portrait.jpg').transformation(Transformation()\n\t.overlay(Overlay.source(\n\tSource.image(\"spiderman_mask\")\n\t.transformation(new Transformation()\n\t.resize(Resize.scale().width(1.1)\n\t.regionRelative()\n\t))\n\t)\n\t.position(Position()\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.faces()))\n\t)\n\t));","codeSnippet":"cloudinary.image('family_portrait.jpg').transformation(Transformation()\n\t.overlay(Overlay.source(\n\tSource.image(\"spiderman_mask\")\n\t.transformation(new Transformation()\n\t.resize(Resize.scale().width(1.1)\n\t.regionRelative()\n\t))\n\t)\n\t.position(Position()\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.faces()))\n\t)\n\t));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setGravity(\"faces\").setOverlay(\"spiderman_mask\").setWidth(1.1).setFlags(\"region_relative\")).generate(\"family_portrait.jpg\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setGravity(\"faces\").setOverlay(\"spiderman_mask\").setWidth(1.1).setFlags(\"region_relative\")).generate(\"family_portrait.jpg\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().gravity(\"faces\").overlay(new Layer().publicId(\"spiderman_mask\")).width(1.1).flags(\"region_relative\")).generate(\"family_portrait.jpg\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation().gravity(\"faces\").overlay(new Layer().publicId(\"spiderman_mask\")).width(1.1).flags(\"region_relative\")).generate(\"family_portrait.jpg\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('family_portrait.jpg').transformation(Transformation()\n\t.overlay(Overlay.source(\n\tSource.image(\"spiderman_mask\")\n\t.transformation(new Transformation()\n\t.resize(Resize.scale().width(1.1)\n\t.regionRelative()\n\t))\n\t)\n\t.position(Position()\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.faces()))\n\t)\n\t));","codeSnippet":"cloudinary.image('family_portrait.jpg').transformation(Transformation()\n\t.overlay(Overlay.source(\n\tSource.image(\"spiderman_mask\")\n\t.transformation(new Transformation()\n\t.resize(Resize.scale().width(1.1)\n\t.regionRelative()\n\t))\n\t)\n\t.position(Position()\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.faces()))\n\t)\n\t));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"family_portrait.jpg\")\n\t overlay(Overlay.source(\n\tSource.image(\"spiderman_mask\") {\n\t transformation(Transformation {\n\t resize(Resize.scale() { width(1.1F)\n\t regionRelative()\n\t }) })\n\t }) {\n\t position(Position() {\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.faces()))\n\t })\n\t }) \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"family_portrait.jpg\")\n\t overlay(Overlay.source(\n\tSource.image(\"spiderman_mask\") {\n\t transformation(Transformation {\n\t resize(Resize.scale() { width(1.1F)\n\t regionRelative()\n\t }) })\n\t }) {\n\t position(Position() {\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.faces()))\n\t })\n\t }) \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"family_portrait.jpg\", {gravity: \"faces\", overlay: new cloudinary.Layer().publicId(\"spiderman_mask\"), width: \"1.1\", flags: \"region_relative\"})","codeSnippet":"$.cloudinary.image(\"family_portrait.jpg\", {gravity: \"faces\", overlay: new cloudinary.Layer().publicId(\"spiderman_mask\"), width: \"1.1\", flags: \"region_relative\"})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"family_portrait.jpg\").overlay(\n source(\n image(\"spiderman_mask\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(new Position().gravity(focusOn(faces())))\n);","codeSnippet":"new CloudinaryImage(\"family_portrait.jpg\").overlay(\n source(\n image(\"spiderman_mask\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(new Position().gravity(focusOn(faces())))\n);","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.agrosoland.com\/demo\/image\/upload\/g_faces,l_spiderman_mask,w_1.1,fl_region_relative,g_faces\/family_portrait.jpg","cloud_name":"demo","host":"res.www.agrosoland.com","type":"upload","resource_type":"image","transformation":[{"gravity":"faces","overlay":"spiderman_mask","width":"1.1","flags":"region_relative"}],"transformation_string":"g_faces,l_spiderman_mask,w_1.1,fl_region_relative,g_faces","url_suffix":"","version":"","secure":true,"public_id":"family_portrait.jpg","extension":"jpg","format":"jpg","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" >
加载代码示例
可能你已经注意到,我们在文章开头用同一种技术向过山车手提供匿名面孔
记住,使用叠加不需覆盖全表情或甚至居中下方使用相对Y坐标向人头加护林帽,以抵充顶部约30%的帽位
<\/Image>","codeSnippet":"
\n\t
\n\t
\n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"smiling_man\")\n .resize(\n crop()\n .zoom(0.6)\n .gravity(focusOn(face()))\n )\n .overlay(\n source(\n image(\"ranger_hat\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(\n new Position()\n .gravity(focusOn(face()))\n .offsetY(-0.3)\n )\n );","codeSnippet":"new CloudinaryImage(\"smiling_man\")\n .resize(\n crop()\n .zoom(0.6)\n .gravity(focusOn(face()))\n )\n .overlay(\n source(\n image(\"ranger_hat\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(\n new Position()\n .gravity(focusOn(face()))\n .offsetY(-0.3)\n )\n );","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":"
<\/cld-image>","codeSnippet":"
\n\t
\n\t
\n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"smiling_man\")\n .resize(\n crop()\n .zoom(0.6)\n .gravity(focusOn(face()))\n )\n .overlay(\n source(\n image(\"ranger_hat\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(\n new Position()\n .gravity(focusOn(face()))\n .offsetY(-0.3)\n )\n );","codeSnippet":"new CloudinaryImage(\"smiling_man\")\n .resize(\n crop()\n .zoom(0.6)\n .gravity(focusOn(face()))\n )\n .overlay(\n source(\n image(\"ranger_hat\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(\n new Position()\n .gravity(focusOn(face()))\n .offsetY(-0.3)\n )\n );","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":"
<\/cl-transformation>
<\/cl-transformation> <\/cl-image>","codeSnippet":"
\n\t
\n\t<\/cl-transformation>\n\t
\n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"smiling_man\")\n .resize(\n crop()\n .zoom(0.6)\n .gravity(focusOn(face()))\n )\n .overlay(\n source(\n image(\"ranger_hat\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(\n new Position()\n .gravity(focusOn(face()))\n .offsetY(-0.3)\n )\n );","codeSnippet":"new CloudinaryImage(\"smiling_man\")\n .resize(\n crop()\n .zoom(0.6)\n .gravity(focusOn(face()))\n )\n .overlay(\n source(\n image(\"ranger_hat\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(\n new Position()\n .gravity(focusOn(face()))\n .offsetY(-0.3)\n )\n );","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('smiling_man', {transformation: [ {gravity: \"face\", zoom: \"0.6\", crop: \"crop\"}, {overlay: new cloudinary.Layer().publicId(\"ranger_hat\"), width: \"1.1\", flags: \"region_relative\", gravity: \"face\", y: \"-0.3\"} ]}).toHtml();","codeSnippet":"cloudinary.imageTag('smiling_man', {transformation: [\n {gravity: \"face\", zoom: \"0.6\", crop: \"crop\"},\n {overlay: new cloudinary.Layer().publicId(\"ranger_hat\"), width: \"1.1\", flags: \"region_relative\", gravity: \"face\", y: \"-0.3\"}\n ]}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"smiling_man\").image(transformation=[ {'gravity': \"face\", 'zoom': \"0.6\", 'crop': \"crop\"}, {'overlay': \"ranger_hat\", 'width': \"1.1\", 'flags': \"region_relative\", 'gravity': \"face\", 'y': \"-0.3\"} ])","codeSnippet":"CloudinaryImage(\"smiling_man\").image(transformation=[\n {'gravity': \"face\", 'zoom': \"0.6\", 'crop': \"crop\"},\n {'overlay': \"ranger_hat\", 'width': \"1.1\", 'flags': \"region_relative\", 'gravity': \"face\", 'y': \"-0.3\"}\n ])","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('smiling_man'))\n\t->resize(Resize::crop()->zoom(0.6)\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::face()))\n\t)\n\t->overlay(Overlay::source(\n\tSource::image(\"ranger_hat\")\n\t->transformation((new Transformation())\n\t->resize(Resize::scale()->width(1.1)\n\t->regionRelative()\n\t))\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::face()))\n->offsetY(-0.3))\n\t);","codeSnippet":"(new ImageTag('smiling_man'))\n\t->resize(Resize::crop()->zoom(0.6)\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::face()))\n\t)\n\t->overlay(Overlay::source(\n\tSource::image(\"ranger_hat\")\n\t->transformation((new Transformation())\n\t->resize(Resize::scale()->width(1.1)\n\t->regionRelative()\n\t))\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::face()))\n->offsetY(-0.3))\n\t);","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"smiling_man\", array(\"transformation\"=>array( array(\"gravity\"=>\"face\", \"zoom\"=>\"0.6\", \"crop\"=>\"crop\"), array(\"overlay\"=>\"ranger_hat\", \"width\"=>\"1.1\", \"flags\"=>\"region_relative\", \"gravity\"=>\"face\", \"y\"=>\"-0.3\") )))","codeSnippet":"cl_image_tag(\"smiling_man\", array(\"transformation\"=>array(\n array(\"gravity\"=>\"face\", \"zoom\"=>\"0.6\", \"crop\"=>\"crop\"),\n array(\"overlay\"=>\"ranger_hat\", \"width\"=>\"1.1\", \"flags\"=>\"region_relative\", \"gravity\"=>\"face\", \"y\"=>\"-0.3\")\n )))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().gravity(\"face\").zoom(0.6).crop(\"crop\").chain() .overlay(new Layer().publicId(\"ranger_hat\")).width(1.1).flags(\"region_relative\").gravity(\"face\").y(-0.3)).imageTag(\"smiling_man\");","codeSnippet":"cloudinary.url().transformation(new Transformation()\n .gravity(\"face\").zoom(0.6).crop(\"crop\").chain()\n .overlay(new Layer().publicId(\"ranger_hat\")).width(1.1).flags(\"region_relative\").gravity(\"face\").y(-0.3)).imageTag(\"smiling_man\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"smiling_man\", :transformation=>[ {:gravity=>\"face\", :zoom=>0.6, :crop=>\"crop\"}, {:overlay=>\"ranger_hat\", :width=>1.1, :flags=>\"region_relative\", :gravity=>\"face\", :y=>-0.3} ])","codeSnippet":"cl_image_tag(\"smiling_man\", :transformation=>[\n {:gravity=>\"face\", :zoom=>0.6, :crop=>\"crop\"},\n {:overlay=>\"ranger_hat\", :width=>1.1, :flags=>\"region_relative\", :gravity=>\"face\", :y=>-0.3}\n ])","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Gravity(\"face\").Zoom(0.6).Crop(\"crop\").Chain() .Overlay(new Layer().PublicId(\"ranger_hat\")).Width(1.1).Flags(\"region_relative\").Gravity(\"face\").Y(-0.3)).BuildImageTag(\"smiling_man\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation()\n .Gravity(\"face\").Zoom(0.6).Crop(\"crop\").Chain()\n .Overlay(new Layer().PublicId(\"ranger_hat\")).Width(1.1).Flags(\"region_relative\").Gravity(\"face\").Y(-0.3)).BuildImageTag(\"smiling_man\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('smiling_man').transformation(Transformation()\n\t.resize(Resize.crop().zoom(0.6)\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t)\n\t.overlay(Overlay.source(\n\tSource.image(\"ranger_hat\")\n\t.transformation(new Transformation()\n\t.resize(Resize.scale().width(1.1)\n\t.regionRelative()\n\t))\n\t)\n\t.position(Position()\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n.offsetY(-0.3))\n\t));","codeSnippet":"cloudinary.image('smiling_man').transformation(Transformation()\n\t.resize(Resize.crop().zoom(0.6)\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t)\n\t.overlay(Overlay.source(\n\tSource.image(\"ranger_hat\")\n\t.transformation(new Transformation()\n\t.resize(Resize.scale().width(1.1)\n\t.regionRelative()\n\t))\n\t)\n\t.position(Position()\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n.offsetY(-0.3))\n\t));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setGravity(\"face\").setZoom(0.6).setCrop(\"crop\").chain() .setOverlay(\"ranger_hat\").setWidth(1.1).setFlags(\"region_relative\").setGravity(\"face\").setY(-0.3)).generate(\"smiling_man\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()\n .setGravity(\"face\").setZoom(0.6).setCrop(\"crop\").chain()\n .setOverlay(\"ranger_hat\").setWidth(1.1).setFlags(\"region_relative\").setGravity(\"face\").setY(-0.3)).generate(\"smiling_man\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().gravity(\"face\").zoom(0.6).crop(\"crop\").chain() .overlay(new Layer().publicId(\"ranger_hat\")).width(1.1).flags(\"region_relative\").gravity(\"face\").y(-0.3)).generate(\"smiling_man\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation()\n .gravity(\"face\").zoom(0.6).crop(\"crop\").chain()\n .overlay(new Layer().publicId(\"ranger_hat\")).width(1.1).flags(\"region_relative\").gravity(\"face\").y(-0.3)).generate(\"smiling_man\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('smiling_man').transformation(Transformation()\n\t.resize(Resize.crop().zoom(0.6)\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t)\n\t.overlay(Overlay.source(\n\tSource.image(\"ranger_hat\")\n\t.transformation(new Transformation()\n\t.resize(Resize.scale().width(1.1)\n\t.regionRelative()\n\t))\n\t)\n\t.position(Position()\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n.offsetY(-0.3))\n\t));","codeSnippet":"cloudinary.image('smiling_man').transformation(Transformation()\n\t.resize(Resize.crop().zoom(0.6)\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t)\n\t.overlay(Overlay.source(\n\tSource.image(\"ranger_hat\")\n\t.transformation(new Transformation()\n\t.resize(Resize.scale().width(1.1)\n\t.regionRelative()\n\t))\n\t)\n\t.position(Position()\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n.offsetY(-0.3))\n\t));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"smiling_man\")\n\t resize(Resize.crop() { zoom(0.6F)\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t })\n\t overlay(Overlay.source(\n\tSource.image(\"ranger_hat\") {\n\t transformation(Transformation {\n\t resize(Resize.scale() { width(1.1F)\n\t regionRelative()\n\t }) })\n\t }) {\n\t position(Position() {\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n offsetY(-0.3F) })\n\t }) \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"smiling_man\")\n\t resize(Resize.crop() { zoom(0.6F)\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t })\n\t overlay(Overlay.source(\n\tSource.image(\"ranger_hat\") {\n\t transformation(Transformation {\n\t resize(Resize.scale() { width(1.1F)\n\t regionRelative()\n\t }) })\n\t }) {\n\t position(Position() {\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n offsetY(-0.3F) })\n\t }) \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"smiling_man\", {transformation: [ {gravity: \"face\", zoom: \"0.6\", crop: \"crop\"}, {overlay: new cloudinary.Layer().publicId(\"ranger_hat\"), width: \"1.1\", flags: \"region_relative\", gravity: \"face\", y: \"-0.3\"} ]})","codeSnippet":"$.cloudinary.image(\"smiling_man\", {transformation: [\n {gravity: \"face\", zoom: \"0.6\", crop: \"crop\"},\n {overlay: new cloudinary.Layer().publicId(\"ranger_hat\"), width: \"1.1\", flags: \"region_relative\", gravity: \"face\", y: \"-0.3\"}\n ]})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"smiling_man\")\n .resize(\n crop()\n .zoom(0.6)\n .gravity(focusOn(face()))\n )\n .overlay(\n source(\n image(\"ranger_hat\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(\n new Position()\n .gravity(focusOn(face()))\n .offsetY(-0.3)\n )\n );","codeSnippet":"new CloudinaryImage(\"smiling_man\")\n .resize(\n crop()\n .zoom(0.6)\n .gravity(focusOn(face()))\n )\n .overlay(\n source(\n image(\"ranger_hat\").transformation(\n new Transformation().resize(scale().width(1.1).regionRelative())\n )\n ).position(\n new Position()\n .gravity(focusOn(face()))\n .offsetY(-0.3)\n )\n );","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.agrosoland.com\/demo\/image\/upload\/c_crop,g_face,z_0.6\/l_ranger_hat,w_1.1,fl_region_relative,g_face,y_-0.3\/smiling_man","cloud_name":"demo","host":"res.www.agrosoland.com","type":"upload","resource_type":"image","transformation":[{"crop_mode":"crop","gravity":"face","zoom":"0.6"},{"overlay":"ranger_hat","width":"1.1","flags":"region_relative","gravity":"face","y":"-0.3"}],"transformation_string":"c_crop,g_face,z_0.6\/l_ranger_hat,w_1.1,fl_region_relative,g_face,y_-0.3","url_suffix":"","version":"","secure":true,"public_id":"smiling_man","extension":"","format":"","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" >
加载代码示例
想要从程序上检查上传图像脸部检测状态时,可请求返回面部坐标数据上传图片或可按需请求使用显式方法上传API或单资源列表细节管理API功能下图显示JSON响应的节选 上传调用脸部
参数设置为真
{.脸部:[513,19号,38号,52、409,26,40码,54号、79,31号,43号,59号、232,32码,40码,54号、321,三十三,41号,57号、160,37号,43号,59号}
代码语言JavaScript高山市javascript)
举例说,你可用此数据计算文本叠加的理想位置, 以免覆盖相片上的任何面孔 。
云化通过为变换增加条件创建程序复杂变换事物之一,你可以基础你的条件面向计数
.
举个例子,你无法总能确定剖面图将是一个人一些人选择上传家族画像、风景或其他图片以表达自己下图使用完全相同的条件变换,即发现一个或多个脸部时应用缩图裁剪,但在图像上使用缩放非脸部并加影比黑边框替代条件以突出差异
代码显示为美联赛
左侧可点击桥图看它使用完全变换URL除图像名(公共ID)外
= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","codeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","status":0,"statusText":"Ok","displayName":"React","packageName":"@cloudinary\/react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"react","framework":"react","language":"react","rawCodeSnippet":"
<\/Image>","codeSnippet":"
\n\t
\n\t
\n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","codeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":"
<\/cld-image>","codeSnippet":"
\n\t
\n\t
\n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","codeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":"
<\/cl-transformation>
<\/cl-transformation> <\/cl-image>","codeSnippet":"
\n\t
\n\t<\/cl-transformation>\n\t
\n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","codeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('nice_couple', {transformation: [ {if: \"fc_gte_1\", gravity: \"faces\", zoom: \"0.5\", width: 200, height: 200, effect: \"shadow:10\", color: \"#acb2b9\", x: 7, y: 7, crop: \"thumb\"}, {if: \"else\", width: 200, height: 200, border: \"3px_solid_black\", crop: \"scale\"} ]}).toHtml();","codeSnippet":"cloudinary.imageTag('nice_couple', {transformation: [\n {if: \"fc_gte_1\", gravity: \"faces\", zoom: \"0.5\", width: 200, height: 200, effect: \"shadow:10\", color: \"#acb2b9\", x: 7, y: 7, crop: \"thumb\"},\n {if: \"else\", width: 200, height: 200, border: \"3px_solid_black\", crop: \"scale\"}\n ]}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"nice_couple\").image(transformation=[ {'if': \"fc_gte_1\", 'gravity': \"faces\", 'zoom': \"0.5\", 'width': 200, 'height': 200, 'effect': \"shadow:10\", 'color': \"#acb2b9\", 'x': 7, 'y': 7, 'crop': \"thumb\"}, {'if': \"else\", 'width': 200, 'height': 200, 'border': \"3px_solid_black\", 'crop': \"scale\"} ])","codeSnippet":"CloudinaryImage(\"nice_couple\").image(transformation=[\n {'if': \"fc_gte_1\", 'gravity': \"faces\", 'zoom': \"0.5\", 'width': 200, 'height': 200, 'effect': \"shadow:10\", 'color': \"#acb2b9\", 'x': 7, 'y': 7, 'crop': \"thumb\"},\n {'if': \"else\", 'width': 200, 'height': 200, 'border': \"3px_solid_black\", 'crop': \"scale\"}\n ])","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('nice_couple'))\n\t->conditional(Conditional::ifCondition(\"face_count >= 1\",(new Transformation())\n\t->effect(Effect::shadow()->strength(10)\n\t->color(Color::rgb(\"acb2b9\"))\n->offsetX(7)\n->offsetY(7))\n\t->resize(Resize::thumbnail()->width(200)\n->height(200)\n->zoom(0.5)\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::faces()))\n\t))\n\t->otherwise((new Transformation())\n\t->resize(Resize::scale()->width(200)\n->height(200))\n\t->border(Border::solid(3,Color::BLACK)))\n\t);","codeSnippet":"(new ImageTag('nice_couple'))\n\t->conditional(Conditional::ifCondition(\"face_count >= 1\",(new Transformation())\n\t->effect(Effect::shadow()->strength(10)\n\t->color(Color::rgb(\"acb2b9\"))\n->offsetX(7)\n->offsetY(7))\n\t->resize(Resize::thumbnail()->width(200)\n->height(200)\n->zoom(0.5)\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::faces()))\n\t))\n\t->otherwise((new Transformation())\n\t->resize(Resize::scale()->width(200)\n->height(200))\n\t->border(Border::solid(3,Color::BLACK)))\n\t);","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"nice_couple\", array(\"transformation\"=>array( array(\"if\"=>\"fc_gte_1\", \"gravity\"=>\"faces\", \"zoom\"=>\"0.5\", \"width\"=>200, \"height\"=>200, \"effect\"=>\"shadow:10\", \"color\"=>\"#acb2b9\", \"x\"=>7, \"y\"=>7, \"crop\"=>\"thumb\"), array(\"if\"=>\"else\", \"width\"=>200, \"height\"=>200, \"border\"=>\"3px_solid_black\", \"crop\"=>\"scale\") )))","codeSnippet":"cl_image_tag(\"nice_couple\", array(\"transformation\"=>array(\n array(\"if\"=>\"fc_gte_1\", \"gravity\"=>\"faces\", \"zoom\"=>\"0.5\", \"width\"=>200, \"height\"=>200, \"effect\"=>\"shadow:10\", \"color\"=>\"#acb2b9\", \"x\"=>7, \"y\"=>7, \"crop\"=>\"thumb\"),\n array(\"if\"=>\"else\", \"width\"=>200, \"height\"=>200, \"border\"=>\"3px_solid_black\", \"crop\"=>\"scale\")\n )))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().if(\"fc_gte_1\").gravity(\"faces\").zoom(0.5).width(200).height(200).effect(\"shadow:10\").color(\"#acb2b9\").x(7).y(7).crop(\"thumb\").chain() .if(\"else\").width(200).height(200).border(\"3px_solid_black\").crop(\"scale\")).imageTag(\"nice_couple\");","codeSnippet":"cloudinary.url().transformation(new Transformation()\n .if(\"fc_gte_1\").gravity(\"faces\").zoom(0.5).width(200).height(200).effect(\"shadow:10\").color(\"#acb2b9\").x(7).y(7).crop(\"thumb\").chain()\n .if(\"else\").width(200).height(200).border(\"3px_solid_black\").crop(\"scale\")).imageTag(\"nice_couple\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"nice_couple\", :transformation=>[ {:if=>\"fc_gte_1\", :gravity=>\"faces\", :zoom=>0.5, :width=>200, :height=>200, :effect=>\"shadow:10\", :color=>\"#acb2b9\", :x=>7, :y=>7, :crop=>\"thumb\"}, {:if=>\"else\", :width=>200, :height=>200, :border=>\"3px_solid_black\", :crop=>\"scale\"} ])","codeSnippet":"cl_image_tag(\"nice_couple\", :transformation=>[\n {:if=>\"fc_gte_1\", :gravity=>\"faces\", :zoom=>0.5, :width=>200, :height=>200, :effect=>\"shadow:10\", :color=>\"#acb2b9\", :x=>7, :y=>7, :crop=>\"thumb\"},\n {:if=>\"else\", :width=>200, :height=>200, :border=>\"3px_solid_black\", :crop=>\"scale\"}\n ])","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().If(\"fc_gte_1\").Gravity(\"faces\").Zoom(0.5).Width(200).Height(200).Effect(\"shadow:10\").Color(\"#acb2b9\").X(7).Y(7).Crop(\"thumb\").Chain() .If(\"else\").Width(200).Height(200).Border(\"3px_solid_black\").Crop(\"scale\")).BuildImageTag(\"nice_couple\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation()\n .If(\"fc_gte_1\").Gravity(\"faces\").Zoom(0.5).Width(200).Height(200).Effect(\"shadow:10\").Color(\"#acb2b9\").X(7).Y(7).Crop(\"thumb\").Chain()\n .If(\"else\").Width(200).Height(200).Border(\"3px_solid_black\").Crop(\"scale\")).BuildImageTag(\"nice_couple\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('nice_couple').transformation(Transformation()\n\t.addTransformation(\"if_fc_gte_1,g_faces,c_thumb,z_0.50,w_200,h_200,e_shadow:10,co_rgb:acb2b9,x_7,y_7\/if_else,w_200,h_200,bo_3px_solid_black\"));","codeSnippet":"cloudinary.image('nice_couple').transformation(Transformation()\n\t.addTransformation(\"if_fc_gte_1,g_faces,c_thumb,z_0.50,w_200,h_200,e_shadow:10,co_rgb:acb2b9,x_7,y_7\/if_else,w_200,h_200,bo_3px_solid_black\"));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().setIf(\"fc_gte_1\").setGravity(\"faces\").setZoom(0.5).setWidth(200).setHeight(200).setEffect(\"shadow:10\").setColor(\"#acb2b9\").setX(7).setY(7).setCrop(\"thumb\").chain() .setIf(\"else\").setWidth(200).setHeight(200).setBorder(\"3px_solid_black\").setCrop(\"scale\")).generate(\"nice_couple\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()\n .setIf(\"fc_gte_1\").setGravity(\"faces\").setZoom(0.5).setWidth(200).setHeight(200).setEffect(\"shadow:10\").setColor(\"#acb2b9\").setX(7).setY(7).setCrop(\"thumb\").chain()\n .setIf(\"else\").setWidth(200).setHeight(200).setBorder(\"3px_solid_black\").setCrop(\"scale\")).generate(\"nice_couple\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().if(\"fc_gte_1\").gravity(\"faces\").zoom(0.5).width(200).height(200).effect(\"shadow:10\").color(\"#acb2b9\").x(7).y(7).crop(\"thumb\").chain() .if(\"else\").width(200).height(200).border(\"3px_solid_black\").crop(\"scale\")).generate(\"nice_couple\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation()\n .if(\"fc_gte_1\").gravity(\"faces\").zoom(0.5).width(200).height(200).effect(\"shadow:10\").color(\"#acb2b9\").x(7).y(7).crop(\"thumb\").chain()\n .if(\"else\").width(200).height(200).border(\"3px_solid_black\").crop(\"scale\")).generate(\"nice_couple\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('nice_couple').transformation(Transformation()\n\t.addTransformation(\"if_fc_gte_1,g_faces,c_thumb,z_0.50,w_200,h_200,e_shadow:10,co_rgb:acb2b9,x_7,y_7\/if_else,w_200,h_200,bo_3px_solid_black\"));","codeSnippet":"cloudinary.image('nice_couple').transformation(Transformation()\n\t.addTransformation(\"if_fc_gte_1,g_faces,c_thumb,z_0.50,w_200,h_200,e_shadow:10,co_rgb:acb2b9,x_7,y_7\/if_else,w_200,h_200,bo_3px_solid_black\"));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"nice_couple\")\n\t addTransformation(\"if_fc_gte_1,g_faces,c_thumb,z_0.50,w_200,h_200,e_shadow:10,co_rgb:acb2b9,x_7,y_7\/if_else,w_200,h_200,bo_3px_solid_black\") \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"nice_couple\")\n\t addTransformation(\"if_fc_gte_1,g_faces,c_thumb,z_0.50,w_200,h_200,e_shadow:10,co_rgb:acb2b9,x_7,y_7\/if_else,w_200,h_200,bo_3px_solid_black\") \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"nice_couple\", {transformation: [ {if: \"fc_gte_1\", gravity: \"faces\", zoom: \"0.5\", width: 200, height: 200, effect: \"shadow:10\", color: \"#acb2b9\", x: 7, y: 7, crop: \"thumb\"}, {if: \"else\", width: 200, height: 200, border: \"3px_solid_black\", crop: \"scale\"} ]})","codeSnippet":"$.cloudinary.image(\"nice_couple\", {transformation: [\n {if: \"fc_gte_1\", gravity: \"faces\", zoom: \"0.5\", width: 200, height: 200, effect: \"shadow:10\", color: \"#acb2b9\", x: 7, y: 7, crop: \"thumb\"},\n {if: \"else\", width: 200, height: 200, border: \"3px_solid_black\", crop: \"scale\"}\n ]})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","codeSnippet":"new CloudinaryImage(\"nice_couple\").conditional(\n ifCondition(\n \"face_count >= 1\",\n new Transformation()\n .effect(shadow().strength(10).color(\"#acb2b9\").offsetX(7).offsetY(7))\n .resize(\n thumbnail().width(200).height(200).zoom(0.5).gravity(focusOn(faces()))\n )\n ).otherwise(\n new Transformation()\n .resize(scale().width(200).height(200))\n .border(solid(3, \"black\"))\n )\n);","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.agrosoland.com\/demo\/image\/upload\/if_fc_gte_1,g_faces,c_thumb,z_0.50,w_200,h_200,e_shadow:10,co_rgb:acb2b9,x_7,y_7\/if_else,w_200,h_200,bo_3px_solid_black\/nice_couple","cloud_name":"demo","host":"res.www.agrosoland.com","type":"upload","resource_type":"image","transformation":[{"if":"fc_gte_1","gravity":"faces","crop_mode":"thumb","zoom":"0.50","width":"200","height":"200","effect":"shadow:10","color":"rgb:acb2b9","x":"7","y":"7"},{"if":"else","width":"200","height":"200","border":"3px_solid_black"}],"transformation_string":"if_fc_gte_1,g_faces,c_thumb,z_0.50,w_200,h_200,e_shadow:10,co_rgb:acb2b9,x_7,y_7\/if_else,w_200,h_200,bo_3px_solid_black","url_suffix":"","version":"","secure":true,"public_id":"nice_couple","extension":"","format":"","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" >
加载代码示例
可学习更多条件变换来.
提醒用户直接上传图像时,除应用所有这些酷物外,你还可以远程使用相同的技巧取回图像类脸书剖面图片.
举个例子,您可以允许用户选择使用脸谱剖面图片作为应用中账面剖面照片的基础,然后应用重定大小、轮廓圆切、艺术特效或任何其他变换以适应网站艺术方向,同时确保所采集照片的检测面仍然是最后图片的主要焦点
使用裁剪和数大变换 脸书剖面图图片记住JFK页数 :
<\/Image>","codeSnippet":"
\n\t
\n\t
\n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"268587306614095\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .effect(artisticFilter(\"sizzle\"))\n .effect(shadow())\n .setDeliveryType(\"facebook\");","codeSnippet":"new CloudinaryImage(\"268587306614095\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .effect(artisticFilter(\"sizzle\"))\n .effect(shadow())\n .setDeliveryType(\"facebook\");","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":"
<\/cld-image>","codeSnippet":"
\n\t
\n\t
\n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"268587306614095\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .effect(artisticFilter(\"sizzle\"))\n .effect(shadow())\n .setDeliveryType(\"facebook\");","codeSnippet":"new CloudinaryImage(\"268587306614095\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .effect(artisticFilter(\"sizzle\"))\n .effect(shadow())\n .setDeliveryType(\"facebook\");","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":"
<\/cl-transformation>
<\/cl-transformation> <\/cl-image>","codeSnippet":"
\n\t
\n\t<\/cl-transformation>\n\t
\n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"268587306614095\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .effect(artisticFilter(\"sizzle\"))\n .effect(shadow())\n .setDeliveryType(\"facebook\");","codeSnippet":"new CloudinaryImage(\"268587306614095\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .effect(artisticFilter(\"sizzle\"))\n .effect(shadow())\n .setDeliveryType(\"facebook\");","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('268587306614095', {type: \"facebook\", transformation: [ {width: 200, height: 200, gravity: \"face\", zoom: \"0.65\", radius: \"max\", effect: \"art:sizzle\", crop: \"thumb\"}, {effect: \"shadow\"} ]}).toHtml();","codeSnippet":"cloudinary.imageTag('268587306614095', {type: \"facebook\", transformation: [\n {width: 200, height: 200, gravity: \"face\", zoom: \"0.65\", radius: \"max\", effect: \"art:sizzle\", crop: \"thumb\"},\n {effect: \"shadow\"}\n ]}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"268587306614095\").image(type=\"facebook\", transformation=[ {'width': 200, 'height': 200, 'gravity': \"face\", 'zoom': \"0.65\", 'radius': \"max\", 'effect': \"art:sizzle\", 'crop': \"thumb\"}, {'effect': \"shadow\"} ])","codeSnippet":"CloudinaryImage(\"268587306614095\").image(type=\"facebook\", transformation=[\n {'width': 200, 'height': 200, 'gravity': \"face\", 'zoom': \"0.65\", 'radius': \"max\", 'effect': \"art:sizzle\", 'crop': \"thumb\"},\n {'effect': \"shadow\"}\n ])","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('268587306614095'))\n\t->resize(Resize::thumbnail()->width(200)\n->height(200)\n->zoom(0.65)\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::face()))\n\t)\n\t->roundCorners(RoundCorners::max())\n\t->effect(Effect::artisticFilter(\n\tArtisticFilter::sizzle()))\n\t->effect(Effect::shadow())\n\t->deliveryType(\"facebook\");","codeSnippet":"(new ImageTag('268587306614095'))\n\t->resize(Resize::thumbnail()->width(200)\n->height(200)\n->zoom(0.65)\n\t->gravity(\n\tGravity::focusOn(\n\tFocusOn::face()))\n\t)\n\t->roundCorners(RoundCorners::max())\n\t->effect(Effect::artisticFilter(\n\tArtisticFilter::sizzle()))\n\t->effect(Effect::shadow())\n\t->deliveryType(\"facebook\");","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"268587306614095\", array(\"type\"=>\"facebook\", \"transformation\"=>array( array(\"width\"=>200, \"height\"=>200, \"gravity\"=>\"face\", \"zoom\"=>\"0.65\", \"radius\"=>\"max\", \"effect\"=>\"art:sizzle\", \"crop\"=>\"thumb\"), array(\"effect\"=>\"shadow\") )))","codeSnippet":"cl_image_tag(\"268587306614095\", array(\"type\"=>\"facebook\", \"transformation\"=>array(\n array(\"width\"=>200, \"height\"=>200, \"gravity\"=>\"face\", \"zoom\"=>\"0.65\", \"radius\"=>\"max\", \"effect\"=>\"art:sizzle\", \"crop\"=>\"thumb\"),\n array(\"effect\"=>\"shadow\")\n )))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().width(200).height(200).gravity(\"face\").zoom(0.65).radius(\"max\").effect(\"art:sizzle\").crop(\"thumb\").chain() .effect(\"shadow\")).type(\"facebook\").imageTag(\"268587306614095\");","codeSnippet":"cloudinary.url().transformation(new Transformation()\n .width(200).height(200).gravity(\"face\").zoom(0.65).radius(\"max\").effect(\"art:sizzle\").crop(\"thumb\").chain()\n .effect(\"shadow\")).type(\"facebook\").imageTag(\"268587306614095\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"268587306614095\", :type=>\"facebook\", :transformation=>[ {:width=>200, :height=>200, :gravity=>\"face\", :zoom=>0.65, :radius=>\"max\", :effect=>\"art:sizzle\", :crop=>\"thumb\"}, {:effect=>\"shadow\"} ])","codeSnippet":"cl_image_tag(\"268587306614095\", :type=>\"facebook\", :transformation=>[\n {:width=>200, :height=>200, :gravity=>\"face\", :zoom=>0.65, :radius=>\"max\", :effect=>\"art:sizzle\", :crop=>\"thumb\"},\n {:effect=>\"shadow\"}\n ])","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Width(200).Height(200).Gravity(\"face\").Zoom(0.65).Radius(\"max\").Effect(\"art:sizzle\").Crop(\"thumb\").Chain() .Effect(\"shadow\")).Action(\"facebook\").BuildImageTag(\"268587306614095\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation()\n .Width(200).Height(200).Gravity(\"face\").Zoom(0.65).Radius(\"max\").Effect(\"art:sizzle\").Crop(\"thumb\").Chain()\n .Effect(\"shadow\")).Action(\"facebook\").BuildImageTag(\"268587306614095\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('268587306614095').transformation(Transformation()\n\t.resize(Resize.thumbnail().width(200)\n.height(200)\n.zoom(0.65)\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t)\n\t.roundCorners(RoundCorners.max())\n\t.effect(Effect.artisticFilter(\n\tArtisticFilter.sizzle()))\n\t.effect(Effect.shadow())\n\t.setDeliveryType(\"facebook\"));","codeSnippet":"cloudinary.image('268587306614095').transformation(Transformation()\n\t.resize(Resize.thumbnail().width(200)\n.height(200)\n.zoom(0.65)\n\t.gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t)\n\t.roundCorners(RoundCorners.max())\n\t.effect(Effect.artisticFilter(\n\tArtisticFilter.sizzle()))\n\t.effect(Effect.shadow())\n\t.setDeliveryType(\"facebook\"));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setType( \"facebook\").setTransformation(CLDTransformation().setWidth(200).setHeight(200).setGravity(\"face\").setZoom(0.65).setRadius(\"max\").setEffect(\"art:sizzle\").setCrop(\"thumb\").chain() .setEffect(\"shadow\")).generate(\"268587306614095\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setType( \"facebook\").setTransformation(CLDTransformation()\n .setWidth(200).setHeight(200).setGravity(\"face\").setZoom(0.65).setRadius(\"max\").setEffect(\"art:sizzle\").setCrop(\"thumb\").chain()\n .setEffect(\"shadow\")).generate(\"268587306614095\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().width(200).height(200).gravity(\"face\").zoom(0.65).radius(\"max\").effect(\"art:sizzle\").crop(\"thumb\").chain() .effect(\"shadow\")).type(\"facebook\").generate(\"268587306614095\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation()\n .width(200).height(200).gravity(\"face\").zoom(0.65).radius(\"max\").effect(\"art:sizzle\").crop(\"thumb\").chain()\n .effect(\"shadow\")).type(\"facebook\").generate(\"268587306614095\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('268587306614095').transformation(Transformation()\n\t.addTransformation(\"w_200,h_200,g_face,c_thumb,z_0.65,r_max,e_art:sizzle\/e_shadow\")\n\t.setDeliveryType(\"facebook\"));","codeSnippet":"cloudinary.image('268587306614095').transformation(Transformation()\n\t.addTransformation(\"w_200,h_200,g_face,c_thumb,z_0.65,r_max,e_art:sizzle\/e_shadow\")\n\t.setDeliveryType(\"facebook\"));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"268587306614095\")\n\t resize(Resize.thumbnail() { width(200)\n height(200)\n zoom(0.65F)\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t })\n\t roundCorners(RoundCorners.max())\n\t effect(Effect.artisticFilter(\n\tArtisticFilter.sizzle()))\n\t effect(Effect.shadow())\n\t deliveryType(\"facebook\") \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"268587306614095\")\n\t resize(Resize.thumbnail() { width(200)\n height(200)\n zoom(0.65F)\n\t gravity(\n\tGravity.focusOn(\n\tFocusOn.face()))\n\t })\n\t roundCorners(RoundCorners.max())\n\t effect(Effect.artisticFilter(\n\tArtisticFilter.sizzle()))\n\t effect(Effect.shadow())\n\t deliveryType(\"facebook\") \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"268587306614095\", {type: \"facebook\", transformation: [ {width: 200, height: 200, gravity: \"face\", zoom: \"0.65\", radius: \"max\", effect: \"art:sizzle\", crop: \"thumb\"}, {effect: \"shadow\"} ]})","codeSnippet":"$.cloudinary.image(\"268587306614095\", {type: \"facebook\", transformation: [\n {width: 200, height: 200, gravity: \"face\", zoom: \"0.65\", radius: \"max\", effect: \"art:sizzle\", crop: \"thumb\"},\n {effect: \"shadow\"}\n ]})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"268587306614095\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .effect(artisticFilter(\"sizzle\"))\n .effect(shadow())\n .setDeliveryType(\"facebook\");","codeSnippet":"new CloudinaryImage(\"268587306614095\")\n .resize(\n thumbnail()\n .width(200)\n .height(200)\n .zoom(0.65)\n .gravity(focusOn(face()))\n )\n .roundCorners(max())\n .effect(artisticFilter(\"sizzle\"))\n .effect(shadow())\n .setDeliveryType(\"facebook\");","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.agrosoland.com\/demo\/image\/facebook\/w_200,h_200,g_face,c_thumb,z_0.65,r_max,e_art:sizzle\/e_shadow\/268587306614095","cloud_name":"demo","host":"res.www.agrosoland.com","type":"facebook","resource_type":"image","transformation":[{"width":"200","height":"200","gravity":"face","crop_mode":"thumb","zoom":"0.65","radius":"max","effect":"art:sizzle"},{"effect":"shadow"}],"transformation_string":"w_200,h_200,g_face,c_thumb,z_0.65,r_max,e_art:sizzle\/e_shadow","url_suffix":"","version":"","secure":true,"public_id":"268587306614095","extension":"","format":"","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" >
加载代码示例
原创脸书简介图片手动照片:脸缩图
微缩放艺术滤波
圆形影影
从其他网站获取图像也可以做同样的事情,例如微博,Google+或图片URL
现今,许多潜在的面部检测技术 可能变得显而易见仿佛鼻孔对面.你可能说.好,我受够面部双关
几乎每个网站都包含本地和用户生成内容,关键是这些人保持显示图片焦点, 不论你如何调整大小、裁剪、添加图片和文本叠加等
云形特征检测能力更新机制使你能够用简单变换参数并用非常可靠结果编程完成所有这些事
准备看你的创造力能带多远 面部检测特征包括免费计划在内的所有计划都提供这些特征,不需加号万一你还没有云型账号,你可以注册免费并试一试