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
Building Data Science Applications with FastAPI

You're reading from   Building Data Science Applications with FastAPI Develop, manage, and deploy efficient machine learning applications with Python

Arrow left icon
Product type Paperback
Published in Oct 2021
Publisher Packt
ISBN-13 9781801079211
Length 426 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
François Voron François Voron
Author Profile Icon François Voron
François Voron
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Introduction to Python and FastAPI
2. Chapter 1: Python Development Environment Setup FREE CHAPTER 3. Chapter 2: Python Programming Specificities 4. Chapter 3: Developing a RESTful API with FastAPI 5. Chapter 4: Managing Pydantic Data Models in FastAPI 6. Chapter 5: Dependency Injections in FastAPI 7. Section 2: Build and Deploy a Complete Web Backend with FastAPI
8. Chapter 6: Databases and Asynchronous ORMs 9. Chapter 7: Managing Authentication and Security in FastAPI 10. Chapter 8: Defining WebSockets for Two-Way Interactive Communication in FastAPI 11. Chapter 9: Testing an API Asynchronously with pytest and HTTPX 12. Chapter 10: Deploying a FastAPI Project 13. Section 3: Build a Data Science API with Python and FastAPI
14. Chapter 11: Introduction to NumPy and pandas 15. Chapter 12: Training Machine Learning Models with scikit-learn 16. Chapter 13: Creating an Efficient Prediction API Endpoint with FastAPI 17. Chapter 14: Implement a Real-Time Face Detection System Using WebSockets with FastAPI and OpenCV 18. Other Books You May Enjoy

Chapter 14: Implement a Real-Time Face Detection System Using WebSockets with FastAPI and OpenCV

In the previous chapter, you learned how to create efficient REST API endpoints to make predictions with trained machine learning models. This approach covers a lot of use cases, given that we have a single observation we want to work on. In some cases, however, we may need to continuously perform predictions on a stream of input, for instance, a face detection system that works in real time with video input. This is exactly what we'll build in this chapter. How? If you remember, besides HTTP endpoints, FastAPI also has the ability to handle WebSockets endpoints, which allow us to send and receive streams of data. In this case, the browser will send into the WebSocket a stream of images from the webcam, and our application will run a face detection algorithm and send back the coordinates of the detected face in the image. For this face detection task, we'll rely on OpenCV, which...

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 $19.99/month. Cancel anytime