Detecção facial com Deluge: dominando a task zoho.ai.detectFace

Detecção facial com Deluge: dominando a task zoho.ai.detectFace

Fala, pessoal!

Hoje quero compartilhar com vocês uma das tasks de Inteligência Artificial mais interessantes do Deluge: a zoho.ai.detectFace. Com ela, conseguimos detectar rostos em imagens diretamente nos nossos scripts, sem precisar de nenhuma API externa de visão computacional. Todo o conteúdo deste artigo é baseado na documentação oficial da Zoho.

O que é a zoho.ai.detectFace?  

A task zoho.ai.detectFace detecta todos os rostos presentes em uma imagem e retorna as coordenadas da caixa delimitadora (bounding box) de cada rosto detectado. Além disso, ela pode retornar atributos adicionais do rosto: emoção, gênero e pose.

Um exemplo prático: dá para prever se um seminário foi envolvente analisando as expressões faciais da plateia em uma foto. Vamos ver esse cenário mais adiante.

Pontos de atenção antes de começar  

A documentação oficial destaca alguns pontos importantes:

       Consumo de chamadas externas: cada execução da task dispara uma requisição de API ao back-end, que é descontada do limite de chamadas externas do serviço, conforme o seu plano. E atenção: o que conta são as execuções reais que recebem resposta, não quantas vezes a task aparece no script. Se ela estiver dentro de um for each que itera 5 vezes, serão consumidas 5 chamadas externas, mesmo que a task apareça apenas uma vez no script.

       Precisão: como toda predição de IA, os resultados podem não ser precisos. A Zoho informa que está trabalhando para melhorar isso.

       Resultados dinâmicos: o mesmo script pode produzir resultados diferentes, conforme o conhecimento da máquina.

Sintaxe  

<response> = zoho.ai.detectFace(<input_image>, <is_dominant_face>, <attribute_list>);

Entendendo cada parâmetro:

Parâmetro

Tipo de dado

Descrição

<response>

KEY-VALUE

Especifica as coordenadas previstas dos rostos e, se solicitado, a emoção, o gênero e a posição de todos os rostos da imagem.

<input_image>

FILE

Especifica o objeto de arquivo que contém a imagem.

Nota: o arquivo só pode ser obtido da nuvem usando a task invokeUrl. Esta task não pode ser aplicada diretamente em campos de imagem ou de upload de arquivo do Zoho Creator. O arquivo pode ser uma imagem nos formatos .png, .jpg ou .jpeg. O tamanho máximo permitido é de 5MB.

<is_dominant_face>

BOOLEAN (true/false)

Especifica a condição para retornar os dados do rosto predominante ou de todos os rostos da imagem.

true - Retorna a bounding box do rosto predominante.

false - Retorna as bounding boxes de todos os rostos da imagem.

<attribute_list> (opcional)

LIST

Especifica a lista de valores a retornar. Os valores suportados são:

gender - Inclui o gênero do rosto na resposta retornada: Male (Masculino) / Female (Feminino).

emotion - Emoção do rosto: Angry (Raiva) / Fear (Medo) / Happy (Feliz) / Neutral (Neutro) / Sad (Triste) / Surprise (Surpresa).

pose - Retorna o ângulo/pose do rosto: Yaw (Guinada - rotação horizontal, para os lados) / Pitch (Inclinação - rotação vertical, para cima e para baixo) / Roll (Rolagem - inclinação lateral da cabeça).

 

Exemplo 1: Detectar rostos em uma imagem  

O script abaixo detecta o rosto da imagem e retorna suas coordenadas:

image_file = invokeurl

    [

         url: "https://c0.wallpaperflare.com/preview/52/764/33/twin-boys.jpg"

    ];

response = zoho.ai.detectFace(image_file, false);

Aqui, image_file é o FILE que representa a imagem da qual os rostos serão detectados, false é o valor BOOLEAN que especifica que a task retornará todos os rostos da imagem, e response é o KEY-VALUE que representa os objetos detectados na imagem e suas coordenadas.

Exemplo 2: Detectar atributos adicionais como gênero, emoção e pose  

O script a seguir detecta os rostos da imagem e retorna a resposta com coordenadas dos rostos, gênero, emoção e pose:

image_file = invokeurl

     [

         url:"https://c0.wallpaperflare.com/preview/52/764/33/twin-boys.jpg"

     ];

 

attribute_list = list();

attribute_list.add("gender");

attribute_list.add("emotion");

attribute_list.add("pose");

response = zoho.ai.detectFace(image_file, false, attribute_list);

A attribute_list é a LIST de valores que precisam ser retornados.

Exemplo 3: Usar a task com imagem enviada em um campo do Zoho Creator  

Nota: este exemplo é aplicável apenas ao Zoho Creator.

O código abaixo baixa a imagem do campo através da API e retorna a resposta com a task zoho.ai.detectFace. A task não pode ser usada diretamente com os campos de formulário do Zoho Creator. Antes, é necessário estabelecer uma connection dentro da aplicação. Para baixar o arquivo enviado no formulário, é preciso usar a Download File API com a task zoho.ai.detectFace:

// Substitua <account_owner_name> pelo nome de usuário do dono da conta Creator.

// Substitua <app_link_name> pelo link name da aplicação alvo.

// Substitua <report_link_name> pelo link name do relatório alvo.

// Substitua <record_ID> pelo ID do registro do qual deseja baixar o arquivo.

// Substitua <field_link_name> pelo link name do campo de upload ou imagem.

image_file = invokeurl

    [

    url: "https://creator.zoho.com/api/v2/<account_owner_name>/<app_link_name>/report/<report_link_name>/<record_ID>/<field_link_name>/download"

    type: GET

    connection: "creator_oauth_connection"

    ];

 

attribute_list = List();

attribute_list.add("gender");

attribute_list.add("emotion");

attribute_list.add("pose");

 

response = zoho.ai.detectFace(image_file, false, attribute_list);

Onde creator_oauth_connection é o TEXT que representa o nome da connection, criada usando o serviço padrão Zoho OAuth. Ao criar a connection, inclua os scopes mencionados na documentação da Zoho Creator - Download File API.

Resumindo  

       Detecta todos os rostos de uma imagem (ou só o predominante) com bounding box

       Atributos opcionais: gender, emotion e pose

       A imagem deve vir da nuvem via invokeUrl (.png, .jpg ou .jpeg, máximo de 5MB)

       No Zoho Creator, use a Download File API com uma connection para imagens de campos de formulário

       Cada execução consome uma chamada externa do limite do seu plano

Links úteis (documentação oficial)  

       Detect Face - Zoho Deluge

       Artificial Intelligence Tasks

       invokeURL Task

       Download File API - Zoho Creator

       Connections - Zoho Creator

 

E aí, já usou as AI Tasks do Deluge em algum projeto? Conta nos comentários!

 

    • Sticky Posts

    • Participe dos encontros exclusivos Zoho User Groups (ZUGs)

      Temos um convite especial para você! Participe dos Zoho User Groups (ZUGs), encontros presenciais que conectam usuários, especialistas e parceiros da Zoho. Esses eventos são a oportunidade perfeita para compartilhar melhores práticas e descobrir como
    • Boas Práticas na Comunidade Zoho Brasil

      Participar da Comunidade Zoho Brasil pode ser uma experiência enriquecedora e colaborativa, mas para que isso aconteça, devemos sempre contribuir para um ambiente positivo e construtivo. Aqui estão algumas dicas de boas práticas para garantir que todos
    • Seja muito bem-vindo à Comunidade Zoho Brasil!

      É com muita empolgação que convidamos você a fazer parte deste novo espaço de colaboração, interação e troca de conhecimentos! Na Comunidade Zoho Brasil você poderá criar tópicos de conversa nos fóruns e também colaborar em discussões produtivas iniciadas
    • A assistente de redação inteligente do Zoho Writer, Zia, agora oferece suporte ao português brasileiro!

      Obtenha sugestões contextuais de ortografia e gramática e melhore a qualidade geral do seu conteúdo com a Zia ao escrever em português. Estamos treinando a Zia em um novo idioma para atender à crescente demanda dos nossos usuários por acesso multilíngue.
    • Recent Topics

    • Introducing Approval SLA for Approval Processes

      Approvals can sometimes be delayed when approvers do not respond within the expected timeframe, which can slow down your recruitment processes. With the new Approval SLA in Zoho Recruit, you can set deadlines for approval requests and define automated
    • Introducing Microsoft Word Integration in Zoho Contracts

      We are excited to announce a new feature that brings contract authoring and negotiation in your familiar environment — the Microsoft Word Integration. What This Integration Brings The Microsoft Word Integration connects Zoho Contracts with the Microsoft
    • Map My Client Locations for Zoho CRM Extension: Turn CRM Addresses Into Action

      Hello everyone, Your CRM knows who your customers are. Now, see where they are on the interactive map directly from Zoho CRM. Introducing Map My Client Locations for Zoho CRM, an extension built for businesses that rely on sales visits, field service,
    • Scheduled and Automated Report Delivery from Zoho Projects

      Zoho Projects has useful reports including task reports, timesheet summaries, and workload charts. However, there is currently no way to schedule these reports to be automatically delivered to stakeholders on a recurring basis. This means: Project managers
    • How can I filter inactive/disable agent tickets?

      Hello, We have an user-agent that left the company and we inactive/disabled his agent. So, now I can no longer filter or search tickets that he is the current owner, or even create a rule to reassign tickets to another person when the ticket is reopen.
    • Add Reauthentication Option for Zoho Bug Tracker Integration in Zoho Desk

      Hello Zoho Desk Team, We hope you're doing well. We would like to request an enhancement to the Zoho Bug Tracker integration within Zoho Desk. Current Limitation: At the moment, there is no option to reauthenticate the Zoho Bug Tracker integration in
    • Dashboards for Customers

      Is it possible to build dashboards for each customers in the community for their tickets?
    • Collaborate Visually with Whiteboard in Zoho Projects

      Whiteboard in Zoho Projects allows you to collaborate visually by creating diagrams, annotating designs, and sketching project workflows using shapes, text, and images within project modules. Team members can work simultaneously, improving productivity
    • 👍 Zoho CRM's Notes now gets Reactions and a new look

      Available in SA and JP DCs. Rolling out to other DCs in phases. Hello everyone, Notes help users capture important updates, collaborate with teammates, and maintain context for records. Now with Note Reactions, users can quickly acknowledge updates, express
    • Fields in MS-Word Template

      With the new MS-Word integration, how does one create fields in an imported MS-Word document which can then automatically be populated with an Intake Form?
    • Displaying only unread tickets in ticket view

      Hello, I was wondering if someone might be able to help me with this one. We use filters to display our ticket list, typically using a saved filter which displays the tickets which are overdue or due today. What I'd really like is another filter that
    • Zoho Bookings Flow Step not Triggering on Appointment booked

      I noticed yesterday that my appointment booked flows were not triggering when we had booked appointments in Zoho Bookings. I checked the trigger and noticed the trigger values updated to be defined to a workspace and service event rather than our whole
    • UCP: Why We Killed the Multi-Portal Mess and Simplified Customer Self-Service

      Let's talk about the multi-portal mess nobody wants to admit that it exists. Your customer needs an invoice from one app, wants a ticket update from another, and has a project waiting in a third, each behind its own login, its own UI, its own "was it
    • Zoho Tables is now available in Zoho One!

      Hello Zoho One users, We’re excited to announce that Zoho Tables is now included as a part of Zoho One suite! As teams grow, managing projects, approvals, inventories, campaign trackers, and operational workflows across multiple spreadsheets become difficult.
    • Zoho Publish is now available in Zoho One!

      Hello Zoho One users, We’re excited to announce that Zoho Publish is now included as part of the Zoho One suite! As businesses grow, managing Google Business Profiles across many locations becomes challenging. Business information needs to stay accurate,
    • 📣 Ask the team behind Zoho SalesIQ: Summer '26 Q&A

      Hi everyone! Following our recent webinars, Summer '26 Release: What's New in Zoho SalesIQ—where we walked you through all the new features, what they do, and how they work—and Driving the AI Evolution: Building Smarter Customer Experiences with Zoho
    • Virtual Option for Fields

      Hi, I would like to be able to choose another option other than Read-Only or Disabled, such as Virtual. And with Virtual, the field is shown on the form and avilable in rules, but NOT saved to the Database. A use case is having multiple Large Lists of
    • Upcoming update to field values in Zoho Books - Zoho Analytics integration

      Hello Users, We'd like to inform you of an upcoming update to the tax_category values in the Zoho Books integration for Zoho Analytics from October 20, 2026. What's Changing? tax_category field values are being renamed to align with the conventions already
    • Prefix & Suffix on Single Line, Number, etc.

      Hi, I would like to have the same Prefix and Suffix that was added to the Unique ID on Text and Number Fields. Use case could be as basic as temperature, as per another Idea I have to use Single Line (Text) for a number that might have leading zeros today,
    • Announcing the new SKILL.md for Zoho CRM and the updated OAS repository!

      We are introducing a new zoho-crm skill to make working with Zoho CRM Developer tools (like APIs, functions, widgets, client scripts, queries etc) easier and faster, with the help of AI in your preferred AI harness like Claude Code, Codex, Cursor, VSCode
    • Handle Leading Zeros in a Number Field

      Hi, If I use a Number Field, set with Min 7 Digits and Max 7 Digits, and enter 0000001, it will result in 1 and an error as it removes the leading zeros, the same with entering 0012340 will result in 12340 and error. So I have to use a Text Field and
    • Kaizen #259 - Working with Zoho CRM APIs using zoho-crm skill

      In the previous Kaizen, we introduced the zoho-crm skill and discussed how it can work with different CRM developer capabilities. The zoho-crm skill makes it easier to work with Zoho CRM without having to remember every API endpoint, request structure,
    • How can I populate dropdown data with information from another source or app?

      I want to maintain a list of items in another app (say in excel or another database) and sync those as items in a drop down menu, instead of copy pasting to import. Is this kind of a feature available?
    • Zoho Community Digest - September 2026 | Part 1

      Hi everyone, and welcome back! September opens with a strong set of updates. Zoho CRM brings workflow automation down to the subform row level and ships a new SKILL.md for AI-assisted development, Zoho Desk introduces conditional branching with Automation
    • Tip #88 – Manage Incoming Support Requests Efficiently with the Service Queue – 'Insider Insights'

      Hello Zoho Assist Community! Not every team has a dedicated IT department or a fully built-out sysadmin setup. For smaller teams, when something breaks, there's no internal ticket system to log into, no helpdesk queue to route through, and no clear way
    • Delete CRM Portal

      How do I delete portals from my CRM? I created one just to test, it is not in use and is disabled but it's existence is preventing me from marking fields in modules as "required" unless I make it 'read/write' in the portal first. I'd rather just delete
    • Creating new Teams meeting from CRM doesn't enable Team functions in the meeting

      Hi I'm trying to set up the meeting integration and I've seen that when I create a Meeting in the CRM and set the location to Online and the Provider to Teams, and complete the boxes, add a participant etc, whilst the meeting is created in Teams, the
    • Zoho Books | Product updates | July 2026

      Hello users, We’re excited to bring you the latest updates in Zoho Books for July 2026! This month's release introduces Terminal Payments, CMP-08 filing for composition taxpayers, SEPA Credit Transfer support, and Self-Billed Credit Notes and Debit Notes
    • Calendar invites from Contacts not being assigned to Account in CRM

      Hi all It's that time of year again when I try to get calendar and meetings sorted in CRM. I have two way sync enabled. I have the option set to check for customer meeting invitation mail and to add them as meetings. However, whilst those meetings show
    • Kaizen #258 - Getting Started with zoho-crm SKILL.md

      Howdy tech wizards, Welcome to a fresh week of Kaizen. This week, we are taking a look at the zoho-crm SKILL.md, an Agent Skill designed to help AI coding agents work with Zoho CRM’s developer capabilities. What is zoho-crm SKILL.md? The zoho-crm skill
    • Zoho Tables is now live in Australia & New Zealand!

      Hey everyone! We’ve got some great news to share — Zoho Tables is now officially available in the Australian Data Center serving users across Australia and New Zealand regions! Yes, it took us a bit longer to get here, but this version of Zoho Tables
    • Dashboard/Component filter by probability

      Hi all Can I request the ability to add a Component or Dashboard filter for Deal Probability? Would be useful to be able to see data of deals more than 60% probable. Olly
    • Stock (on-hand) Items not updated after using Composite items

      Hi there, I created a Composite item (consist of 3 items). After I created the Composite item, I invoiced it and shipped the items. However the actual stock on hand of the 3items didn't change at all. Have you guys encountered this? Thank you Regards,
    • Is there a way to show contact emails in the Account?

      I know I can see the emails I have sent and received on a Contact detail view, but I want to be able to see all the emails that have been sent and received between all an Accounts Contacts on the Account Detail view. That way when I see the Account detail
    • Important changes for users with Zoho accounts in the UAE and other Data Centers

      What's changing? Previously, the same email address could be used to create separate Zoho accounts in both the UAE data center and another Zoho data center (such as US, EU, IN, AU, JP, CA, SA or SG). With this change, an email address can be associated
    • Conditional Layouts On Multi Select Field

      How we can use Conditional Layouts On Multi Select Field field? Please help. Moderation update: Multi-select picklist fields are now supported in Layout Rules. Additionally, Layout Rules is now available in the Professional Edition. These updates have
    • Zoho Marketing Automation WhatsApp Campaign Import Sync for Zoho Analytics

      WhatsApp is a critical channel in modern marketing, yet WhatsApp Campaign metrics from Zoho Marketing Automation currently cannot be natively imported into Zoho Analytics via the default advanced analytics connector. Integrating this into the standard
    • merge the Multiple POs to single PO if Vendor of PO"s --in Zoho Inventory

      HI Merge the Multiple POs to single PO if Vendor of PO"s are Same ----in Zoho inventory Please provide any work around to achive this .
    • Delug script

      I have been looking at auto-update a amount (home currency) field from another module. Zoho native multicurrency was used in the other module (we have 4 here). Custom script was input with no error, but the field was not updated on trigger. Script as
    • Is there a CRM Deluge function available to convert an RTF (rich text field) to plain text (with no formatting tags)?

      I know that we can run reports so that RTF fields can either show as plain text or the text or the text with the formatting fields included (which is wonderful, btw, as it helps me adjust tags when I need to troubleshoot and just see what I need to see
    • Next Page