Company
Date Published
Author
Team Clarifai
Word count
1191
Language
English
Hacker News points
None

Summary

The text provides a detailed tutorial on using Clarifai's new Face Detection model in conjunction with JavaScript to create a humorous photo filter application that overlays emojis on detected faces in images. The model, which is in its alpha release, identifies facial positions in images by returning bounding box coordinates, making it useful for various applications such as security camera footage and digital photography. The tutorial guides users through setting up a Clarifai account, initializing a new application with the JavaScript client, and creating a project that leverages file input to select images and apply the face detection model. Once faces are identified, the tutorial explains how to map the bounding box coordinates to actual image dimensions and overlay emojis, like the poop emoji, on the detected faces using HTML canvas. The process involves converting images to base-64 strings, predicting face positions with the Clarifai model, and drawing the emojis on a canvas element, encouraging users to explore creative variations by using different emojis.