VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-apply-computer-vision-to-build-an-emotion-based-dog-filter-in-python-3

โ‡ฑ How To Apply Computer Vision to Build an Emotion-Based Dog Filter in Python 3 | DigitalOcean


How To Apply Computer Vision to Build an Emotion-Based Dog Filter in Python 3

Published on April 3, 2019
๐Ÿ‘ How To Apply Computer Vision to Build an Emotion-Based Dog Filter in Python 3

The author selected Girls Who Code to receive a donation as part of the Write for DOnations program.

Introduction

Computer vision is a subfield of computer science that aims to extract a higher-order understanding from images and videos. This field includes tasks such as object detection, image restoration (matrix completion), and optical flow. Computer vision powers technologies such as self-driving car prototypes, employee-less grocery stores, fun Snapchat filters, and your mobile deviceโ€™s face authenticator.

In this tutorial, you will explore computer vision as you use pre-trained models to build a Snapchat-esque dog filter. For those unfamiliar with Snapchat, this filter will detect your face and then superimpose a dog mask on it. You will then train a face-emotion classifier so that the filter can pick dog masks based on emotion, such as a corgi for happy or a pug for sad. Along the way, you will also explore related concepts in both ordinary least squares and computer vision, which will expose you to the fundamentals of machine learning.

๐Ÿ‘ A working dog filter

As you work through the tutorial, youโ€™ll use OpenCV, a computer-vision library, numpy for linear algebra utilities, and matplotlib for plotting. Youโ€™ll also apply the following concepts as you build a computer-vision application:

  • Ordinary least squares as a regression and classification technique.
  • The basics of stochastic gradient neural networks.

While not necessary to complete this tutorial, youโ€™ll find it easier to understand some of the more detailed explanations if youโ€™re familiar with these mathematical concepts:

  • Fundamental linear algebra concepts: scalars, vectors, and matrices.
  • Fundamental calculus: how to take a derivative.

You can find the complete code for this tutorial at https://github.com/do-community/emotion-based-dog-filter.

Letโ€™s get started.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

๐Ÿ‘ Alvin Wan
Alvin Wan
Author
AI PhD Student @ UC Berkeley
See author profile

I'm a diglot by definition, lactose intolerant by birth but an ice-cream lover at heart. Call me wabbly, witling, whatever you will, but I go by Alvin

Managed the Write for DOnations program, wrote and edited community articles, and makes things on the Internet. Expertise in DevOps areas including Linux, Ubuntu, Debian, and more.

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Awesome! Fun and interesting tutorial!

๐Ÿ‘ Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOceanโ€™s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow โ€” whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

ยฉ 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.