Pular para conteúdo

AWS REKOGNITION - Recognize Celebrities (Reconhecimento de Celebridades)

O que é esta operação?

A operação recognizeCelebrities do AWS Rekognition é responsável por identificar celebridades, figuras públicas e pessoas famosas em imagens.

Por que esta operação existe?

O Rekognition recognizeCelebrities existe para:

  1. Mídia Social: Tag automático de celebridades em fotos
  2. Jornalismo: Identificar personalidades em eventos
  3. Marketing: Detectar influenciadores em campanhas
  4. Monitoramento de Marca: Rastrear aparições de celebridades
  5. Gestão de Eventos: Identificar VIPs automaticamente

Como funciona internamente?

Código interno (aws-rekognition.executor.ts:182-193):

private async recognizeCelebrities(client: RekognitionClient, data: any, context: ExecutionContext): Promise<any> {
  const command = new RecognizeCelebritiesCommand({
    Image: this.getImageSource(data, context),
  });

  const response = await client.send(command);
  return {
    celebrityFaces: response.CelebrityFaces || [],
    unrecognizedFaces: response.UnrecognizedFaces || [],
    count: response.CelebrityFaces?.length || 0,
  };
}

Parâmetros

Campo Tipo Obrigatório Descrição
operation string Sim Deve ser "recognizeCelebrities"
config object Sim Credenciais AWS
s3Bucket/s3Key string Condicional Localização da imagem
imageBytes string Condicional Imagem em base64
responseVariable string Sim Variável para resultado

Exemplo: Tag Automático de Celebridades

{
  "name": "Identificação de Celebridades em Fotos",
  "nodes": [
    {
      "id": "start_1",
      "type": "start",
      "position": { "x": 100, "y": 100 },
      "data": { "label": "Início" }
    },
    {
      "id": "media_1",
      "type": "media",
      "position": { "x": 300, "y": 100 },
      "data": {
        "label": "Upload",
        "parameters": {
          "message": "🌟 Envie foto de evento para identificar celebridades:",
          "variableName": "eventPhoto",
          "mediaType": "image"
        }
      }
    },
    {
      "id": "rekognition_1",
      "type": "aws_rekognition",
      "position": { "x": 500, "y": 100 },
      "data": {
        "label": "Reconhecer Famosos",
        "operation": "recognizeCelebrities",
        "config": {
          "region": "us-east-1",
          "accessKeyId": "KEY",
          "secretAccessKey": "SECRET"
        },
        "imageBytes": "{{eventPhoto}}",
        "responseVariable": "celebrities"
      }
    },
    {
      "id": "condition_1",
      "type": "condition",
      "position": { "x": 700, "y": 100 },
      "data": {
        "label": "Verificar Celebridades",
        "parameters": {
          "variableA": "{{celebrities.count}}",
          "operator": "greaterThan",
          "variableB": "0"
        }
      }
    },
    {
      "id": "message_found",
      "type": "message",
      "position": { "x": 900, "y": 50 },
      "data": {
        "label": "Encontrado",
        "parameters": {
          "message": "🌟 Encontramos {{celebrities.count}} celebridade(s) na foto!\n\nTags aplicados automaticamente."
        }
      }
    },
    {
      "id": "message_not_found",
      "type": "message",
      "position": { "x": 900, "y": 150 },
      "data": {
        "label": "Não Encontrado",
        "parameters": {
          "message": "😊 Nenhuma celebridade identificada nesta foto."
        }
      }
    },
    {
      "id": "end_1",
      "type": "end",
      "position": { "x": 1100, "y": 100 },
      "data": { "label": "Fim" }
    }
  ],
  "edges": [
    { "source": "start_1", "target": "media_1" },
    { "source": "media_1", "target": "rekognition_1" },
    { "source": "rekognition_1", "target": "condition_1" },
    { "source": "condition_1", "target": "message_found", "label": "true" },
    { "source": "condition_1", "target": "message_not_found", "label": "false" },
    { "source": "message_found", "target": "end_1" },
    { "source": "message_not_found", "target": "end_1" }
  ]
}

Resposta do Node

{
  "celebrityFaces": [
    {
      "Name": "Celebrity Name",
      "Id": "abc123",
      "MatchConfidence": 98.5,
      "Urls": ["https://imdb.com/..."],
      "Face": {
        "BoundingBox": {},
        "Confidence": 99.9
      }
    }
  ],
  "unrecognizedFaces": [],
  "count": 1
}

Boas Práticas

SIM: Verifique MatchConfidence > 90% | Use Urls para mais informações | Combine com detectFaces para rostos não reconhecidos

NÃO: Não assuma 100% de precisão | Não use para decisões legais sem validação

💡 Dica: O campo unrecognizedFaces contém rostos detectados que não são celebridades conhecidas.

detectFaces | compareFaces