Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Computer Vision Projects with OpenCV and Python 3

You're reading from   Computer Vision Projects with OpenCV and Python 3 Six end-to-end projects built using machine learning with OpenCV, Python, and TensorFlow

Arrow left icon
Product type Paperback
Published in Dec 2018
Publisher Packt
ISBN-13 9781789954555
Length 182 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Matthew Rever Matthew Rever
Author Profile Icon Matthew Rever
Matthew Rever
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Setting Up an Anaconda Environment FREE CHAPTER 2. Image Captioning with TensorFlow 3. Reading License Plates with OpenCV 4. Human Pose Estimation with TensorFlow 5. Handwritten Digit Recognition with scikit-learn and TensorFlow 6. Facial Feature Tracking and Classification with dlib 7. Deep Learning Image Classification with TensorFlow 8. Other Books You May Enjoy

Retraining the human pose estimation model

We will now discuss how to handle videos and retrain our human pose estimation network. We have already covered face detection and how to apply a model to a video. Opening a video is pretty straightforward and OpenCV provides a mechanism for that. It's basically doing the same thing one frame at a time. The following example shows the code for this:

predictor_path = "./shape_predictor_68_face_landmarks.dat"
detector = dlib.get_fronta1_face_detector()
predictor = dlib.shape_predictor(predictor_path)

#Uncomment Line below if you want to use your webcam
#cap = cv2.VideoCapture(0) #0 is the first camera on your computer, change if you
#more than one camera

#Comment out the Line below if using webcam
cap = cv2.VideoCapture('./rollerc.mp4')
figure(100)
font = cv2.FONT_HERSHEY_SIMPLEX

First, we need to create a cv2 capture device...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime