First, please make sure you have signed up for a Sieve account as per the quickstart guide.

Install the Sieve CLI

pip install https://mango.sievedata.com/v1/client_package/sievedata-0.0.1.1.2-py3-none-any.whl

Then, export your Sieve API key as an environment variable. You can find your API key in the Sieve dashboard.

export SIEVE_API_KEY=YOUR_API_KEY

Create a Workflow

Create a new folder and add the files below.

import sieve
from typing import Dict, Tuple
from yolo import Yolo
from splitter import VideoSplitter

@sieve.workflow(name="yolo_object_detection")
def yolo_workflow(video: sieve.Video) -> Dict:
    images = VideoSplitter(video)
    yolo_outputs = Yolo()(images)
    return yolo_outputs

Deploy the Workflow

You workflow will be deployed. You can monitor the status via your terminal or on the Sieve dashboard.

sieve deploy

Run the Workflow

You can run the workflow on a video file. You can do this via the dashboard, the API, or the CLI. We can use this file to test.

CLI

sieve push yolo_object_detection '{"video": {"url": "https://storage.googleapis.com/sieve-test-videos-central/01-lebron-dwade.mp4"}}'

API

curl --request POST \
    --url https://mango.sievedata.com/v1/push \
    --header "X-API-Key: $SIEVE_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "workflow_name": "yolo_object_detection",
      "inputs": {
        "video": {
          "url": "https://storage.googleapis.com/sieve-test-videos-central/01-lebron-dwade.mp4"
        }
      }
    }'

Dashboard

Navigate to the yolo_object_detection worklow on the dashboard, enter the video URL, and click Send Request.

More Examples

You can find more examples in the Sieve Examples Repo.