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

      • Outgoing Mail Blocked – Suspicious Login Activity (Need Clarification and Solution)

        Hello, I’m currently facing an issue where my Zoho Mail account has been blocked due to “suspicious login activity,” and outgoing emails are restricted. Here are the details shown: Block type: Outgoing mail blocked Reason: Suspicious login activity A
      • Account Blocked due to Suspicious Activity.

        Hello, Trying to get access to my account, I have found this message above in the subject of this message. I am unable to log back to my account (see err. mess. below.) and thus cannot get rif of this following the Zoho procedure : I followed the step
      • Zoho Recruit mailserver get blocked by Microsoft!

        Hi, We have experienced this issue twice now, where Zoho Recruit outbound IP addresses are being blocked by Microsoft. We are confident that Microsoft is the blocking party, as all outbound emails to candidates with @hotmail.com, @live.com, and @outlook.com
      • Months of WooCommerce–Zoho Inventory sync failures and repeated support requests – has anyone experienced this?

        Months of WooCommerce–Zoho Inventory sync failures and repeated support requests – has anyone experienced this? I run a small retail business using WooCommerce and Zoho One. For months, I have been trying to resolve recurring synchronisation failures
      • Name autocomplete

        Hi, During searching emails the web tool does not always propose the auto-completion of the saved emails. As a result I either have to go to contacts and look up the exact email, or the exact full name including the middle name and any dots, which is
      • How to Manage Two GST Numbers / Two Companies in a Single Zoho Inventory Organization?

        Hi Team, We currently have two separate legal entities: A Proprietorship Firm with its own GSTIN A Private Limited Company with a different GSTIN However, operationally, both companies deal with the same products, and we would like to manage the physical
      • View Cannot Use UPC as Criteria

        When creating a new custom view, the UPC field is not available as a criterion for the view. This seems strange, because both ISBN and EAN are available in the dropdown. Because of this, I feel like the situation is possibly an oversight rather than by
      • How To Implement an Auto-Check-out Feature for Attendance?

        If an employee forgets to check out, the system should automatically check out the employee at 6:30 PM
      • What are the best practices for managing tax records and financial information for a small business?

        I’m interested in learning how other small business owners and accounting professionals organize their financial records and prepare for tax filing. With bookkeeping, expense tracking, income records, and tax documents all needing to stay accurate, having
      • How to Open Google Takeout and Thunderbird MBOX Files?

        MBOX files are used by email clients and services, such as Google Takeout and Mozilla Thunderbird, to store email messages. It can, however, be difficult to open such files if you don't have an email programme that is compatible. Google Takeout enables
      • Automating CRM backup storage?

        Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
      • not able to convert pdf to jpg and other forms and vice versa.

        i want to change my pdf to jpg, word, etc and some times jpg to pdf. i don't know how to do in this.
      • How Can I Collect Payments for Credit Sales Directly from Zoho POS Billing App?

        We are currently testing Zoho POS for a retail business and have encountered an issue with collecting payments on outstanding invoices from customers who purchase on credit. When we process a Credit Sale, Zoho POS correctly creates an Unpaid Invoice.
      • Indeed has retired Organic (Free) job posting support for Staffing Agency edition users

        Dear Zoho Recruit Users, Due to a policy change by Indeed, Organic Job Posting support for staffing agencies is no longer be available in all regions, except Japan. Keep in mind that Corporate HR edition accounts will not be impacted by this change in
      • Changing an existing item to different accounts & inventory-tracked

        Hi everyone, I have an item in Zoho Books that was originally set up as a non-inventory item. Over time, I associated it with different sales and purchase accounts, and I now have many invoices, bills, and reports that use this item. My business process
      • How to Convert Emails to PDF Format in Batch

        It is helpful to convert emails into PDF format when you want to save important messages, when you need to share business correspondence, or when you wish to keep email records for future reference. PDF files can be readily opened, printed, and shared
      • Create a single record from multiple images with ICR

        Hello all, Zia's Intelligent Character Recognition can now create a single record from multiple images based on the configured ICR rule. Users can upload up to three images at once, such as an ID, a passport, and a business card, and Zia will extract
      • Lookups and Custom Modules

        I created a Custom Module that I'm calling "Item Purchasing Group". This module will store information for groups of Items that must be purchased together (including minimum overall quantities and/or values, etc.). This will have a one-to-many relationship
      • Zoho Books | Product updates | October 2026

        Hello users, October brings a range of new features and enhancements to Zoho Books, designed to simplify compliance, streamline accounting workflows, and improve inventory management. From the launch of the Nigeria Edition and France’s e-invoicing capabilities
      • Create custom rollup summary fields in Zoho CRM

        Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
      • Button or Links order

        Is there a way to re-order the buttons or links that are created? Moderation Update: With our recent enhancement to custom button creation from the layout editor, administrators can now reorder custom buttons directly from the layout editor, and this
      • Bulk updating tags

        My organisation handles a number of restricted funds. We previously did this by having a chart of accounts where each restricted fund has its own income and expense accounts. However, our accountant changed this, moving all transactions into accounts
      • Download or Backup Bulk Emails from IMAP Server

        Taking email messages from an IMAP server and saving them is a wise method for ensuring that important emails are kept safe and easy to access. No matter whether you have a business email address or a personal mailbox, keeping a local copy of your emails
      • Zoho Writer Label Template Merge/Print Via API/Webhook/Flow

        Short version of goal: To be able to kick off a Zoho Writer Label Template Document via API or Webhook or even using Zoho Flow. As of right now I have been unable to figure out a way to do that. Long version of goal: We would like to press a button (run
      • Kaizen #263: Using Zoho CRM Skill to Build Widgets

        Hello everyone! Welcome back to another exciting Kaizen post. In the previous Kaizen posts, we introduced the zoho-crm skill.md and explored how it can help with Zoho CRM APIs, Client Scripts, complex COQL queries, and Skill to build Queries. In this
      • Zoho notebook No login

        Hello Team, I recently downloaded and installed the latest version of zoho notebook for windows. But I am not able to login without providing any sso or email address. Did you removed the no login feature for this app? This is just a windows app. can
      • Search is completely broken for PC

        I go to note, try to search for "mtga" and it shows 702 results (it's a big note), highlights all letters "m" and I can't find anything. Same for "gathering" - it thinkgs I think only for "g". Looking for "zoho" shows as if I searched only for "z". Using
      • Behind a great customer experience is a team

        Hi everyone, October is here, and the first week marks the Customer service week. Each year, we thank our customer service professionals. Service professionals are all around us, even in our own workplaces: They handle essential administrative work like
      • What's New - August and September 2026 | Zoho Backstage

        Hello everyone, August and September bring a fresh wave of intelligence to Zoho Backstage. AI takes the spotlight with tools that help you create content, support attendees, and manage how AI fits into your events. Alongside AI, we’ve refined email communication,
      • Images Not Displaying Properly in Zoho Desk

        Hi, We are experiencing an issue with image rendering in Zoho Desk, affecting both incoming and outgoing emails. Images embedded in email conversations are not displaying properly. Instead, we see broken image icons or empty placeholders where the images
      • 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
      • Zoho Projects - Has something changed regarding to linking Projects and Deals via the API?

        I am trying to link Zoho Projects to Deals in CRM using the API, but each time, the Deal Contact is added as a Client user and receives an email invite asking them to join the organisation. These are internal projects and the customer should not have
      • How long does it take to review campaigns?

        Hello Zoho, i scheduled my campaigns yesterday afternoon and it has been under review for over how many hours and those campaigns were supposed to be out yesterday so new ones can go out today. Is there something i'm doing wrong?
      • Convert MSG to PDF in Bulk with Attachment Free

        Microsoft Outlook saves each email as an MSG file, keeping with it key information like the sender, the recipient, the subject, the date, the body of the message, and any attachments. It can, however, be quite difficult to access a large number of MSG
      • Using Mail Merge Template to Print Documents with One Subform Record's Fields per Document

        Hello, We have a Mail Merge template created in Zoho Writer which is not able to perform the functionality which is currently required to automate the documentation task portion of our process. The CRM module we are primarily using is based on a "Loans"
      • Convert MBOX to PST File Using Free Methods

        MBOX is a mailbox format that is used by various email clients and services, such as Thunderbird, Apple Mail, Eudora, and Google Takeout. Yet, in order to be able to open your MBOX emails in Microsoft Outlook, you have to convert them from MBOX to PST
      • Zoho Community Digest - September 2026 | Part 4

        Hi everyone, and welcome back! The final week of September brought a revamped Books integration in Zoho CRM and Zoho Key Service for LLM access without API keys, Zoho Creator's audit trail becoming a full enterprise-grade auditing system, and Zoho One
      • Automate weekly reports from Channels | Zoho Cliq AI use case #01

        Scrolling endlessly through numerous threads in a Cliq channel and manually counting how many have been closed, how long people took to reply, and who actually participated can be tedious. After 20 minutes, you might have a number that no one can verify.
      • Apple Mail to Outlook Converter - Export Apple Mac Mail to PST File

        Apple Mail is a well-known email application among people who use Macs, whereas Microsoft Outlook is widely employed for both personal and business use. Should you decide to move from Apple Mail to Outlook, you'll probably need to transfer your mailbox
      • Zoho Tables is now part of Zoho One!

        Hey everyone! We've got some exciting news to share. Zoho Tables is now included in your Zoho One subscription at no extra cost. If you're already on Zoho One, head to your app list, add Zoho Tables, and get started right away. You don't need a separate
      • Next Page