This pull request introduces an implementation of the Segment Anything v2 (SAM2) pipeline within the AI worker.
This implements the basic functionality needed to perform segmentation on an image, including specifying points and labels. Returns the scores, logits, and low-res-masks.
In addition, this PR introduces a new method of adding pipelines dependencies without breaking existing implementations present in ai-runner. Example usage for local development:
The existing Dockerfile is specified as a 'base' image ( e.g. : FROM livepeer/ai-runner:base ) in cmd/segment-anything-2/Dockerfile.segment_anything_2.
This pull request introduces an implementation of the Segment Anything v2 (SAM2) pipeline within the AI worker.
This implements the basic functionality needed to perform segmentation on an image, including specifying points and labels. Returns the scores, logits, and low-res-masks.
In addition, this PR introduces a new method of adding pipelines dependencies without breaking existing implementations present in ai-runner. Example usage for local development:
The existing Dockerfile is specified as a 'base' image ( e.g. :
FROM livepeer/ai-runner:base
) in cmd/segment-anything-2/Dockerfile.segment_anything_2.The go-livepeer PR here implements the logic necessary to launch this pipeline-specific container when appropriate : https://github.com/livepeer/go-livepeer/pull/3131