SDK Reference
sieve.workflow
def workflow(
name: str = None
)
A sieve.workflow
is a collection of sieve.function
s and sieve.Model
s that are executed in a specific order.
A sieve.workflow
is executed by pushing data to the workflow using the API, the CLI, or the SDK.
A sieve.workflow
can be deployed to Sieve using the CLI, or the SDK.
Single Function Workflow Example
import sieve
@sieve.workflow(name="single_function_workflow")
def single_function_workflow(image: sieve.Image) -> sieve.Image:
return sieve.reference("sieve-developer/mediapipe-face-detector")(image)
Object Tracking Example
import sieve
from typing import Dict, Tuple
from yolo import Yolo
from tracker import SORT
from splitter import VideoSplitter
from visualizer import draw_boxes
@sieve.workflow(name="yolo_object_tracking")
def yolosplit(video: sieve.Video) -> Dict:
images = VideoSplitter(video)
yolo_outputs = Yolo()(images)
return SORT(yolo_outputs)
@sieve.workflow(name="yolo_object_tracking_visualize")
def yolo_visualize(video: sieve.Video) -> Tuple[sieve.Video, Dict]:
images = VideoSplitter(video)
yolo_outputs = Yolo()(images)
visualized = draw_boxes(images, yolo_outputs)
combined = sieve.reference("sieve-developer/frame-combiner")(visualized)
return combined, SORT(yolo_outputs)
Arguments
name
Name of the workflow.