Example: Parallelized Face Detection
Building a parallelized face detection app with Sieve
Because Sieve makes it easy to push to function queues, it’s easy to parallelize data processing operations in just a few lines of code. In this example, we’ll build an app that performs face detection on a video using Sieve.
Let’s start with a simple function that has ffmpeg
installed. This will allow us to split a video into many frames.
Now let’s write code that splits the video into frames and starts passing it into a face detector. In this case, we’ll use a face detection model that is already available on Sieve, though you could also deploy your own.
Once defined, you can run this as follows. You’ll notice the code calling detector.run
directly, where detector
is the actual function annotated with @sieve.function
. In this case, the function will first deploy and then will be remotely called.
You can view this job on your dashboard, or start seeing data stream to your terminal.
Was this page helpful?