Skip to content

Code-first video & image, rendered natively on WebGPU.

fix(vision-sam): correct license scope, headers and SAM 3 naming

okanasl645dd1349de7
diff --git a/.changeset/prompted-sam2-vision.md b/.changeset/prompted-sam2-vision.md
index 3659d054..215fc277 100644
--- a/.changeset/prompted-sam2-vision.md
+++ b/.changeset/prompted-sam2-vision.md
@@ -6,4 +6,4 @@
"@framefields/webgpu-renderers": patch
---
-Add prompted SAM 2.1 Tiny and SAM 3 / 3.1 video segmentation and semantic text selection to clip vision, decoupled into a dedicated `@framefields/vision-sam` package under the Meta SAM License. Includes temporal memory, point/box corrections, semantic text selection, cached frame seeking, and time-remapped matte reuse. Selected-object masks, geometry, motion, and optional matched pose are exposed through standard vision signals. Model assets download dynamically at runtime to local cache with SHA-256 verification upon explicit license agreement.
+Add prompted SAM 2.1 Tiny and SAM 3 video segmentation and semantic text selection to clip vision, decoupled into a dedicated `@framefields/vision-sam` package under the Meta SAM License. Includes temporal memory, point/box corrections, semantic text selection, cached frame seeking, and time-remapped matte reuse. Selected-object masks, geometry, motion, and optional matched pose are exposed through standard vision signals. Model assets download dynamically at runtime to local cache with SHA-256 verification upon explicit license agreement.
diff --git a/.changeset/sam-license-scope.md b/.changeset/sam-license-scope.md
new file mode 100644
index 00000000..3bf6f8c3
--- /dev/null
+++ b/.changeset/sam-license-scope.md
@@ -0,0 +1,6 @@
+---
+"@framefields/vision-sam": minor
+"framefields": patch
+---
+
+SAM 2.1 (Apache-2.0 weights) no longer asks for Meta's SAM License; only SAM 3 does (`acceptSamLicense` / `sam3.acceptLicense` / `FRAMEFIELDS_ACCEPT_SAM_LICENSE=1`). `sam2.acceptLicense` and `Sam2Tracker`'s `acceptLicense` are removed. The package's sources no longer carry a Meta copyright header, and the model is named SAM 3 throughout.
diff --git a/README.md b/README.md
index 75e9339e..5a68f08c 100644
--- a/README.md
+++ b/README.md
@@ -206,12 +206,11 @@ const subject = Layer.video("assets/source.mp4", {
}).withVision({ mode: "matte" });
comp.add(subject);
const tracked = comp.vision(subject, {
- acceptSamLicense: true,
sam2: { prompts: [{ frame: 0, points: [{ x: 0.5, y: 0.5, label: 1 }] }] },
});
const target = tracked.signals.objects.get(1);
-// SAM 3: every student in the shot as one mask, from one prompt
+// SAM 3 (Meta SAM License, accepted explicitly): every student in the shot as one mask, from one prompt
comp.vision(subject, {
acceptSamLicense: true,
sam3: { text: "students in black jackets", merge: true },
diff --git a/packages/framefields/src/clip-vision.ts b/packages/framefields/src/clip-vision.ts
index edcbaced..78304c24 100644
--- a/packages/framefields/src/clip-vision.ts
+++ b/packages/framefields/src/clip-vision.ts
@@ -27,11 +27,11 @@ import type { VisionProps } from "./effects/index.js";
export type PoseKeypointName = (typeof COCO17_KEYPOINT_NAMES)[number];
export interface ClipVisionOptions {
- /** Prompted SAM 2.1 Tiny video segmentation. Pose is opt-in in this mode. */
+ /** Prompted SAM 2.1 (Tiny or Small) video segmentation. Pose is opt-in in this mode. */
sam2?: Sam2Options;
- /** Optional SAM 3.1 / SAM 3 point/box or text selection with temporal tracking. Mutually exclusive with sam2. */
+ /** SAM 3 point/box or text selection with temporal tracking. Mutually exclusive with sam2. */
sam3?: Sam3Options;
- /** Explicitly agree to Meta's SAM License terms for downloading/running SAM models. */
+ /** Explicitly agree to Meta's SAM License terms, required to download and run SAM 3. */
acceptSamLicense?: boolean;
/** Composition frame the clip's first frame plays on (default 0). */
startFrame?: number;
@@ -547,8 +547,6 @@ export class ClipVision implements ClipSubjectSource {
baseUrl: this.options.baseUrl,
frameCount,
model: settings.model,
- acceptLicense:
- this.options.acceptSamLicense ?? this.options.sam2?.acceptLicense,
});
this.sam2Frame = first - 1;
}
diff --git a/packages/vision-sam/NOTICE.md b/packages/vision-sam/NOTICE.md
index f6c05b62..f2a761f5 100644
--- a/packages/vision-sam/NOTICE.md
+++ b/packages/vision-sam/NOTICE.md
@@ -1,9 +1,18 @@
-# Legal Architecture & License Notice: @framefields/vision-sam
+# Notice: @framefields/vision-sam
-This package (`@framefields/vision-sam`) provides Segment Anything Model (SAM 2.1 & SAM 3 / 3.1) video tracking, prompt encoding, and semantic text selection for Framefields.
+This package provides prompted video tracking for framefields with Meta's Segment Anything models: SAM 2.1 (Tiny and Small) and SAM 3. Its source code is written for framefields; it contains no code or weights distributed by Meta.
-## License Segregation
-1. **Core Decoupling**: The Framefields SDK and core libraries are licensed under the Apache 2.0 license. In accordance with the terms of the Meta SAM License, SAM inference implementations and derivative models are maintained strictly isolated in this standalone package.
-2. **Model Weights Decoupling**: No SAM ONNX model binaries or weight derivatives are bundled in the Apache-2.0 core repository or published npm tarball. Model weights are dynamically downloaded on-demand to the user's local cache (`~/.cache/framefields/models`) directly from verified upstream sources upon explicit license acceptance.
-3. **Runtime License Acceptance**: Users of this package must accept the Meta SAM License terms directly at runtime, either by passing `acceptLicense: true` in tracking/vision options or by setting the environment variable `FRAMEFIELDS_ACCEPT_SAM_LICENSE=1`.
+## Model weights
+No model weights ship in this package or in any framefields package. Each model is downloaded on first use from a pinned Hugging Face revision into the local model cache (`~/.cache/framefields/models`), and verified by size and SHA-256.
+
+| Model | Weights license | Acceptance |
+| --- | --- | --- |
+| SAM 2.1 Tiny / Small (Diffusion Studio ONNX exports of `facebook/sam2.1-hiera-*`) | Apache-2.0 | none |
+| SAM 3 (ONNX exports of Meta's SAM 3 checkpoints) | Meta SAM License | required at runtime |
+
+## Accepting the SAM License
+
+Before SAM 3 weights are downloaded or run, you must accept Meta's SAM License (https://github.com/facebookresearch/sam3/blob/main/LICENSE): pass `acceptLicense: true` to `Sam3Tracker` (or `acceptSamLicense: true` in `comp.vision` options), or set `FRAMEFIELDS_ACCEPT_SAM_LICENSE=1`. Your use of SAM 3 is then governed by that license.
+
+`framefields` loads this package only when a clip uses `sam2` or `sam3`; it is an optional peer dependency, so projects that do not use SAM never install it.
diff --git a/packages/vision-sam/package.json b/packages/vision-sam/package.json
index 3c15be3f..44f51cc9 100644
--- a/packages/vision-sam/package.json
+++ b/packages/vision-sam/package.json
@@ -1,6 +1,6 @@
{
"name": "@framefields/vision-sam",
- "description": "Isolated Segment Anything Model (SAM 2.1 Tiny & SAM 3 / 3.1) video tracking and semantic selection under Meta's SAM License.",
+ "description": "Prompted video tracking for framefields: SAM 2.1 Tiny / Small and SAM 3 (text selection, several objects). SAM 3 weights are under Meta's SAM License.",
"version": "2.8.1",
"private": false,
"publishConfig": {
diff --git a/packages/vision-sam/src/index.ts b/packages/vision-sam/src/index.ts
index 2dccbcca..bbb79929 100644
--- a/packages/vision-sam/src/index.ts
+++ b/packages/vision-sam/src/index.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
export * from "./license.js";
export * from "./models/registry.js";
export * from "./sam2/memory.js";
diff --git a/packages/vision-sam/src/license.ts b/packages/vision-sam/src/license.ts
index 49dbac70..18203b7b 100644
--- a/packages/vision-sam/src/license.ts
+++ b/packages/vision-sam/src/license.ts
@@ -1,25 +1,18 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
export const SAM_LICENSE_TERMS_URL =
"https://github.com/facebookresearch/sam3/blob/main/LICENSE";
export interface SamLicenseOptions {
- /** Explicitly agree to Meta's SAM License terms to download or run SAM models. */
+ /** Explicitly agree to Meta's SAM License terms to download or run SAM 3 models. */
readonly acceptLicense?: boolean;
}
/**
* Ensures that the user has explicitly accepted Meta's SAM License terms before
- * downloading model weights or performing inference.
+ * downloading SAM 3 weights or performing inference. SAM 2.1's weights are Apache-2.0 and
+ * need no acceptance.
*/
export function assertSamLicenseAccepted(
- context = "Segment Anything Model (SAM)",
+ context = "SAM 3",
options?: SamLicenseOptions,
): void {
if (options?.acceptLicense) return;
@@ -31,9 +24,9 @@ export function assertSamLicenseAccepted(
throw new Error(
`Meta SAM License agreement required for ${context}:\n` +
- `Segment Anything Model (SAM 2 / SAM 3) code and weights are subject to Meta's SAM License.\n` +
+ `SAM 3's model weights are subject to Meta's SAM License.\n` +
`Review terms at: ${SAM_LICENSE_TERMS_URL}\n` +
- `To download and run SAM models in Framefields, you must explicitly accept the terms by:\n` +
+ `To download and run SAM 3 in Framefields, you must explicitly accept the terms by:\n` +
` 1. Passing 'acceptLicense: true' (or 'acceptSamLicense: true' in ClipVision options), or\n` +
` 2. Setting the environment variable FRAMEFIELDS_ACCEPT_SAM_LICENSE=1.`,
);
diff --git a/packages/vision-sam/src/models/registry.ts b/packages/vision-sam/src/models/registry.ts
index bcfd89a5..8c9502ba 100644
--- a/packages/vision-sam/src/models/registry.ts
+++ b/packages/vision-sam/src/models/registry.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import {
registerVisionModel,
VISION_MODELS,
diff --git a/packages/vision-sam/src/sam2/memory.ts b/packages/vision-sam/src/sam2/memory.ts
index 54299c07..d6c6992f 100644
--- a/packages/vision-sam/src/sam2/memory.ts
+++ b/packages/vision-sam/src/sam2/memory.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
/** CPU-owned memory bank; neural inference uses the configured vision execution provider. */
export interface Sam2Memory {
readonly frame: number;
diff --git a/packages/vision-sam/src/sam2/sam2.e2e.test.ts b/packages/vision-sam/src/sam2/sam2.e2e.test.ts
index 217481c0..b750fa39 100644
--- a/packages/vision-sam/src/sam2/sam2.e2e.test.ts
+++ b/packages/vision-sam/src/sam2/sam2.e2e.test.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import { NodeWebGPUProvider } from "@framefields/vision";
import { describe, expect, it } from "vitest";
import { Sam2Tracker } from "./tracker.js";
@@ -43,7 +35,6 @@ describe.skipIf(!enabled)("SAM 2.1 on native Dawn", () => {
provider: new NodeWebGPUProvider(),
frameCount: 8,
model,
- acceptLicense: true,
});
try {
for (let frame = 0; frame < 8; frame++) {
diff --git a/packages/vision-sam/src/sam2/sam2.test.ts b/packages/vision-sam/src/sam2/sam2.test.ts
index 3352bbbc..0b92fc98 100644
--- a/packages/vision-sam/src/sam2/sam2.test.ts
+++ b/packages/vision-sam/src/sam2/sam2.test.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import { VisionModelStore } from "@framefields/vision";
import { describe, expect, it } from "vitest";
import { SAM_MODELS, SAM2_EXPORTS } from "../models/registry.js";
@@ -33,7 +25,6 @@ async function pipeline() {
const store = new VisionModelStore({
modelsDir: `/tmp/framefields-sam2-test-${crypto.randomUUID()}`,
verify: false,
- acceptLicense: true,
fetchImpl: async (url) =>
new Response(
String(url).endsWith("constants.json")
@@ -67,19 +58,18 @@ async function pipeline() {
{ pointer_pos: float(new Float32Array(16 * 64), [16, 64]) },
]);
return {
- tracker: await Sam2Tracker.create({ store, provider, acceptLicense: true }),
+ tracker: await Sam2Tracker.create({ store, provider }),
provider,
};
}
describe("SAM 2 video pipeline", () => {
- it("requires license agreement before running", async () => {
+ it("needs no SAM License acceptance: SAM 2.1 weights are Apache-2.0", async () => {
const prev = process.env.FRAMEFIELDS_ACCEPT_SAM_LICENSE;
delete process.env.FRAMEFIELDS_ACCEPT_SAM_LICENSE;
try {
- await expect(
- Sam2Tracker.create({ acceptLicense: false }),
- ).rejects.toThrow("Meta SAM License agreement required");
+ const { tracker } = await pipeline();
+ tracker.release();
} finally {
if (prev !== undefined) process.env.FRAMEFIELDS_ACCEPT_SAM_LICENSE = prev;
}
@@ -160,7 +150,6 @@ describe("SAM 2 video pipeline", () => {
it("rejects an unknown model before downloading anything", async () => {
await expect(
Sam2Tracker.create({
- acceptLicense: true,
// @ts-expect-error not a SAM 2.1 model
model: "huge",
}),
diff --git a/packages/vision-sam/src/sam2/tracker.ts b/packages/vision-sam/src/sam2/tracker.ts
index b821c637..c81519ec 100644
--- a/packages/vision-sam/src/sam2/tracker.ts
+++ b/packages/vision-sam/src/sam2/tracker.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import {
createDefaultSessionProvider,
imageToTensor,
@@ -19,7 +11,6 @@ import {
type VisionTensorOutputs,
} from "@framefields/vision";
import { z } from "zod";
-import { assertSamLicenseAccepted } from "../license.js";
import {
ensureSamModelsRegistered,
SAM2_EXPORTS,
@@ -67,8 +58,6 @@ export interface Sam2TrackerOptions extends VisionModelStoreOptions {
readonly frameCount?: number;
/** Checkpoint: `"tiny"` (default, 512², fast) or `"small"` (1024², finer detail). */
readonly model?: Sam2Model;
- /** Explicitly agree to Meta's SAM License terms to download or run SAM models. */
- readonly acceptLicense?: boolean;
}
function floats(outputs: VisionTensorOutputs, name: string): Float32Array {
@@ -111,14 +100,9 @@ export class Sam2Tracker {
}
static async create(options: Sam2TrackerOptions = {}): Promise<Sam2Tracker> {
- assertSamLicenseAccepted("SAM 2.1", options);
ensureSamModelsRegistered();
- const store =
- options.store ??
- new VisionModelStore({
- ...options,
- acceptLicense: options.acceptLicense ?? true,
- });
+ // SAM 2.1's weights are Apache-2.0: no SAM License acceptance.
+ const store = options.store ?? new VisionModelStore(options);
const model = options.model ?? "tiny";
if (!(model in SAM2_EXPORTS))
throw new Error(
diff --git a/packages/vision-sam/src/sam2/types.ts b/packages/vision-sam/src/sam2/types.ts
index 7ff2539e..9fd45d09 100644
--- a/packages/vision-sam/src/sam2/types.ts
+++ b/packages/vision-sam/src/sam2/types.ts
@@ -1,13 +1,4 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import type { VisionImageInput } from "@framefields/vision";
-import type { SamLicenseOptions } from "../license.js";
import type { Sam2Model } from "../models/registry.js";
/** Normalized source-image coordinates. Labels 2/3 form a box's opposite corners. */
@@ -23,7 +14,7 @@ export interface Sam2Prompt {
readonly points: readonly Sam2Point[];
}
-export interface Sam2Options extends SamLicenseOptions {
+export interface Sam2Options {
readonly prompts: readonly Sam2Prompt[];
/** Metadata for object and class signals; SAM does not classify objects. */
readonly category?: string;
diff --git a/packages/vision-sam/src/sam3/encoder.test.ts b/packages/vision-sam/src/sam3/encoder.test.ts
index e33f4e13..b0f45100 100644
--- a/packages/vision-sam/src/sam3/encoder.test.ts
+++ b/packages/vision-sam/src/sam3/encoder.test.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import type {
SessionProvider,
VisionModelStore,
diff --git a/packages/vision-sam/src/sam3/encoder.ts b/packages/vision-sam/src/sam3/encoder.ts
index c0c1d938..6cbbc69d 100644
--- a/packages/vision-sam/src/sam3/encoder.ts
+++ b/packages/vision-sam/src/sam3/encoder.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import {
imageToTensor,
type SessionProvider,
diff --git a/packages/vision-sam/src/sam3/graphs.ts b/packages/vision-sam/src/sam3/graphs.ts
index a3a7f7df..2493bdb9 100644
--- a/packages/vision-sam/src/sam3/graphs.ts
+++ b/packages/vision-sam/src/sam3/graphs.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
/** SAM 3's small prompt/position heads, assembled from the pinned upstream weights.
* The video export omits dense prompts and learned temporal constants. These heads
* restore the original operations, without approximating a semantic mask by clicks.
diff --git a/packages/vision-sam/src/sam3/memory.ts b/packages/vision-sam/src/sam3/memory.ts
index fce59b90..ca6c6d36 100644
--- a/packages/vision-sam/src/sam3/memory.ts
+++ b/packages/vision-sam/src/sam3/memory.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import type { Sam2Memory } from "../sam2/memory.js";
/** Dynamic memory lengths: never duplicate unavailable early-frame memories. */
diff --git a/packages/vision-sam/src/sam3/sam3.e2e.test.ts b/packages/vision-sam/src/sam3/sam3.e2e.test.ts
index 5f937e8c..4d0becb4 100644
--- a/packages/vision-sam/src/sam3/sam3.e2e.test.ts
+++ b/packages/vision-sam/src/sam3/sam3.e2e.test.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import { NodeWebGPUProvider } from "@framefields/vision";
import { describe, expect, it } from "vitest";
import { Sam3Tracker } from "./tracker.js";
@@ -33,7 +25,7 @@ function picture(frame: number) {
return { width, height, data };
}
-describe.skipIf(!enabled)("SAM 3 / 3.1 on native Dawn WebGPU", () => {
+describe.skipIf(!enabled)("SAM 3 on native Dawn WebGPU", () => {
it("propagates a prompted object across video frames with temporal memory", async () => {
const tracker = await Sam3Tracker.create({
provider: new NodeWebGPUProvider(),
diff --git a/packages/vision-sam/src/sam3/sam3.test.ts b/packages/vision-sam/src/sam3/sam3.test.ts
index f9a38c72..4ac865f2 100644
--- a/packages/vision-sam/src/sam3/sam3.test.ts
+++ b/packages/vision-sam/src/sam3/sam3.test.ts
@@ -1,17 +1,9 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import { describe, expect, it } from "vitest";
import { Sam3MemoryBank, sam3Position } from "./memory.js";
import { Sam3Tracker, sam3Mask } from "./tracker.js";
import { validateSam3Prompts } from "./types.js";
-describe("SAM 3 / 3.1 video tracker", () => {
+describe("SAM 3 video tracker", () => {
it("enforces license agreement before creation", async () => {
const prev = process.env.FRAMEFIELDS_ACCEPT_SAM_LICENSE;
delete process.env.FRAMEFIELDS_ACCEPT_SAM_LICENSE;
diff --git a/packages/vision-sam/src/sam3/selection.test.ts b/packages/vision-sam/src/sam3/selection.test.ts
index fc9a7a6d..442e7a86 100644
--- a/packages/vision-sam/src/sam3/selection.test.ts
+++ b/packages/vision-sam/src/sam3/selection.test.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import { describe, expect, it } from "vitest";
import { mergeSelections } from "./selection.js";
diff --git a/packages/vision-sam/src/sam3/selection.ts b/packages/vision-sam/src/sam3/selection.ts
index d740ec46..3d3300d7 100644
--- a/packages/vision-sam/src/sam3/selection.ts
+++ b/packages/vision-sam/src/sam3/selection.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
/**
* Text-selected instances as one mask (`sam3.merge`): each pixel keeps its most confident
* instance's logit, so the union is positive wherever any instance is.
diff --git a/packages/vision-sam/src/sam3/text-selector.ts b/packages/vision-sam/src/sam3/text-selector.ts
index 332cf8c3..df0eed57 100644
--- a/packages/vision-sam/src/sam3/text-selector.ts
+++ b/packages/vision-sam/src/sam3/text-selector.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import type {
SessionProvider,
VisionModelStore,
diff --git a/packages/vision-sam/src/sam3/tracker.ts b/packages/vision-sam/src/sam3/tracker.ts
index 2075e579..3572dbf0 100644
--- a/packages/vision-sam/src/sam3/tracker.ts
+++ b/packages/vision-sam/src/sam3/tracker.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import {
createDefaultSessionProvider,
type SessionProvider,
@@ -117,7 +109,7 @@ export class Sam3Tracker {
) {}
static async create(options: Sam3TrackerOptions = {}): Promise<Sam3Tracker> {
- assertSamLicenseAccepted("SAM 3 / 3.1", options);
+ assertSamLicenseAccepted("SAM 3", options);
ensureSamModelsRegistered();
if (
options.frameCount !== undefined &&
diff --git a/packages/vision-sam/src/sam3/types.ts b/packages/vision-sam/src/sam3/types.ts
index b65fe40f..6565df65 100644
--- a/packages/vision-sam/src/sam3/types.ts
+++ b/packages/vision-sam/src/sam3/types.ts
@@ -1,11 +1,3 @@
-/**
- * Copyright (c) Meta Platforms, Inc. and affiliates.
- * All rights reserved.
- *
- * This source code is licensed under the SAM License found in the
- * LICENSE file in the root directory of this source tree.
- */
-
import type { SamLicenseOptions } from "../license.js";
import type { Sam3Precision } from "../models/registry.js";
import type { Sam2Point } from "../sam2/types.js";
diff --git a/plugins/framefields/skills/framefields-vision/SKILL.md b/plugins/framefields/skills/framefields-vision/SKILL.md
index 4d2338d8..6d884576 100644
--- a/plugins/framefields/skills/framefields-vision/SKILL.md
+++ b/plugins/framefields/skills/framefields-vision/SKILL.md
@@ -157,7 +157,7 @@ Detection picks "the largest person". Use SAM when the subject is **a specific**
pnpm add @framefields/vision-sam
```
-`@framefields/vision-sam` is an optional peer of `framefields`. It is loaded only when a clip uses `sam2` or `sam3`; without it, those clips fail with an install message. The package's code is under Meta's SAM License (the SAM 2.1 weights themselves are Apache-2.0), so both `sam2` and `sam3` need explicit acceptance: `acceptSamLicense: true` on the clip (or `acceptLicense: true` inside `sam2` / `sam3`), or `FRAMEFIELDS_ACCEPT_SAM_LICENSE=1`. Import `Sam2Tracker` / `Sam3Tracker` from `@framefields/vision-sam` when you drive SAM directly.
+`@framefields/vision-sam` is an optional peer of `framefields`. It is loaded only when a clip uses `sam2` or `sam3`; without it, those clips fail with an install message. SAM 2.1's weights are Apache-2.0 and need no acceptance. SAM 3's weights are under Meta's SAM License, so `sam3` needs explicit acceptance before anything downloads: `acceptSamLicense: true` on the clip (or `acceptLicense: true` inside `sam3`), or `FRAMEFIELDS_ACCEPT_SAM_LICENSE=1`. Ask the user before accepting it on their behalf. Import `Sam2Tracker` / `Sam3Tracker` from `@framefields/vision-sam` when you drive SAM directly.
### Prompts
@@ -190,7 +190,6 @@ comp.vision(students, {
// SAM 2.1 Small: a small subject, a box plus a point, and a correction later
const ball = comp.vision(plate, {
- acceptSamLicense: true,
sam2: {
model: "small",
category: "ball",
@@ -311,7 +310,7 @@ report.tracks; // [{ trackId, category, frames: [start, end], centerPath, … }]
| Part of a fast-moving garment drops out | `variant: "m"`, or `keyBackground: true` |
| Faint halo on dark backgrounds | Lower `featherRadius`, or raise `maskThreshold` (e.g. `0.6`) |
| "Prompted sam2/sam3 tracking needs the optional @framefields/vision-sam package" | `pnpm add @framefields/vision-sam` |
-| "Meta SAM License agreement required" | `acceptSamLicense: true` or `FRAMEFIELDS_ACCEPT_SAM_LICENSE=1` |
+| "Meta SAM License agreement required" (SAM 3) | `acceptSamLicense: true` or `FRAMEFIELDS_ACCEPT_SAM_LICENSE=1`, once the user accepts the license |
| "A prompted clip matte requires the source aspect ratio" | Matte at the source aspect, crop afterwards |
| Log says `Inference on the CPU` on a GPU machine | The log's `reason` says why; on Linux NVIDIA check the CUDA 12 / cuDNN 9 libraries, or force `FRAMEFIELDS_VISION_PROVIDER` to see the error |
| A preview of a clip outside the project shows nothing | Add its folder to `startPreview(…, { root: [process.cwd(), dir] })` |