Next Generation Computer Vision using Machine Learning

alpha2phi
3 min readOct 3, 2021

A starter guide to computer vision using MediaPipe and OpenCV.

Photo by Greg Rakozy on Unsplash

Overview

In this article, let’s explore computer vision and the latest development in this area. I am going to show you code snippets using MediaPipe by Google to demonstrate various ML solutions and explore what is possible with the library.

Codebase

Let’s establish the codebase to use for all scenarios. The following code snippet is used to either capture video from your device camera or a video file.

  • Using OpenCV, I can capture video either from a device camera or a video file.
# cap = cv2.VideoCapture(0) # Capture from camera. Adjust the number
cap = cv2.VideoCapture(capture) # Capture from video file,e.g. mp4

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.