## Basic model info - Model name: meta/meta sam-3d - Model description: Meta SAM 3D reconstructs objects and human bodies from images and aligns body and object meshes into a shared 3D scene. - Endpoint name: objects ## Model schema The model schema is defined in the OpenAPI schema: [OpenAPI Schema](https://oapi.sunra.ai/main/meta/sam-3d/a5de3f0ac9fefd6e6d291f0105d486b4f8b7970e.json) ### Model input schema The model input schema is: ```json { "additionalProperties": false, "properties": { "prompt": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "car", "title": "Prompt" }, "image_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" } ], "title": "Image Url" }, "seed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Seed" }, "box_prompts": { "items": { "additionalProperties": false, "properties": { "object_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Object Id" }, "x_max": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "X Max" }, "x_min": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "X Min" }, "y_max": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Y Max" }, "y_min": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Y Min" } }, "title": "BoxPrompt", "type": "object" }, "title": "Box Prompts", "type": "array" }, "detection_threshold": { "anyOf": [ { "maximum": 1, "minimum": 0.1, "type": "number" }, { "type": "null" } ], "title": "Detection Threshold" }, "enable_safety_checker": { "default": true, "title": "Enable Safety Checker", "type": "boolean" }, "export_textured_glb": { "default": false, "title": "Export Textured Glb", "type": "boolean" }, "mask_urls": { "items": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" } ] }, "title": "Mask Urls", "type": "array" }, "point_prompts": { "items": { "additionalProperties": false, "properties": { "label": { "anyOf": [ { "enum": [ 0, 1 ], "type": "integer" }, { "type": "null" } ], "title": "Label" }, "object_id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Object Id" }, "x": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "X" }, "y": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Y" } }, "title": "PointPrompt", "type": "object" }, "title": "Point Prompts", "type": "array" }, "pointmap_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "string" }, { "type": "null" } ], "title": "Pointmap Url" } }, "required": [ "image_url" ], "title": "Sam3DObjectsInput", "type": "object" } ``` ### Model output schema The model output schema is: ```json { "anyOf": [ { "additionalProperties": false, "properties": { "artifacts_zip": { "anyOf": [ { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, { "type": "null" } ] }, "gaussian_splat": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, "individual_glbs": { "anyOf": [ { "items": { "anyOf": [ { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, { "type": "null" } ] }, "type": "array" }, { "type": "null" } ], "title": "Individual Glbs" }, "individual_splats": { "anyOf": [ { "items": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, "type": "array" }, { "type": "null" } ], "title": "Individual Splats" }, "metadata": { "title": "Metadata" }, "model_glb": { "anyOf": [ { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, { "type": "null" } ] } }, "required": [ "gaussian_splat", "metadata" ], "title": "ObjectsOutput", "type": "object" }, { "additionalProperties": false, "properties": { "meshes": { "anyOf": [ { "items": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, "type": "array" }, { "type": "null" } ], "title": "Meshes" }, "metadata": { "title": "Metadata" }, "model_glb": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, "visualization": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" } }, "required": [ "model_glb", "visualization", "metadata" ], "title": "BodyOutput", "type": "object" }, { "additionalProperties": false, "properties": { "body_mesh_ply": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, "metadata": { "title": "Metadata" }, "model_glb": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, "scene_glb": { "anyOf": [ { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" }, { "type": "null" } ] }, "visualization": { "properties": { "content_type": { "description": "The mime type of the file.", "title": "Content Type", "type": "string" }, "file_name": { "description": "The name of the file. It will be auto-generated if not provided.", "title": "File Name", "type": "string" }, "file_size": { "description": "The size of the file in bytes.", "title": "File Size", "type": "integer" }, "url": { "description": "The URL where the file can be downloaded from.", "title": "Url", "type": "string" } }, "required": [ "content_type", "file_name", "file_size", "url" ], "title": "SunraFile", "type": "object" } }, "required": [ "body_mesh_ply", "model_glb", "visualization", "metadata" ], "title": "AlignOutput", "type": "object" } ], "title": "Response Get Request Result Requests Request Id Get" } ``` ## Example inputs and outputs Use the following example inputs and outputs to understand the model. ### Input example ```json { "prompt": "car", "image_url": "", "seed": null, "box_prompts": [ ], "detection_threshold": null, "enable_safety_checker": true, "export_textured_glb": false, "mask_urls": [ ], "point_prompts": [ ], "pointmap_url": null } ``` ### Output example ```json { } ``` ## Model code examples ### JavaScript ```javascript import { sunra } from "@sunra/client"; const result = await sunra.subscribe("meta/sam-3d/objects", { input: { image_url: '', prompt: 'car', pointmap_url: null, mask_urls: [], enable_safety_checker: true, detection_threshold: null, box_prompts: [], export_textured_glb: false, seed: null, point_prompts: [] }, logs: true, onQueueUpdate: (update) => { console.log(`Status Update: ${update.status}, Request ID: ${update.request_id}`); }, }); console.log(result.data); console.log(result.requestId); ``` ### Python ```python import sunra_client result = sunra_client.subscribe( "meta/sam-3d/objects", arguments={ "image_url": "", "prompt": "car", "pointmap_url": None, "mask_urls": [], "enable_safety_checker": True, "detection_threshold": None, "box_prompts": [], "export_textured_glb": False, "seed": None, "point_prompts": [] }, with_logs=True, on_enqueue=print, on_queue_update=print, ) print(result) ``` ### Java ```java import ai.sunra.client.*; import java.util.Map; import com.google.gson.JsonObject; var client = SunraClient.withEnvCredentials(); var response = client.subscribe( "meta/sam-3d/objects", SubscribeOptions.builder() .input(Map.of( "image_url", "", "prompt", "car", "pointmap_url", null, "mask_urls", , "enable_safety_checker", true, "detection_threshold", null, "box_prompts", , "export_textured_glb", false, "seed", null, "point_prompts", )) .resultType(JsonObject.class) .onQueueUpdate(update -> System.out.printf( "\nStatus Update: %s, Request ID: %s%n", update.getStatus(), update.getRequestId() )) .logs(true) .build() ); System.out.println("Completed!"); System.out.println(response.getData()); ``` ### Kotlin ```kotlin import ai.sunra.client.kt.* import com.google.gson.JsonObject val client = createSunraClient() val response = client.subscribe( endpointId = "meta/sam-3d/objects", input = mapOf( "image_url" to "", "prompt" to "car", "pointmap_url" to null, "mask_urls" to , "enable_safety_checker" to true, "detection_threshold" to null, "box_prompts" to , "export_textured_glb" to false, "seed" to null, "point_prompts" to ), options = ai.sunra.client.kt.SubscribeOptions(logs = true), onUpdate = { update -> println("\nStatus Update: ${update.status}, Request ID: ${update.requestId}") } ) println("Completed!") println(response.data) ``` ### Curl ```bash curl --request POST \ --url https://api.sunra.ai/v1/queue/meta/sam-3d/objects \ --header "Authorization: Key $SUNRA_KEY" \ --header "Content-Type: application/json" \ --data '{"image_url":"","prompt":"car","pointmap_url":null,"mask_urls":[],"enable_safety_checker":true,"detection_threshold":null,"box_prompts":[],"export_textured_glb":false,"seed":null,"point_prompts":[]}' ``` ## Model readme > SAM 3D Objects reconstructs one or more prompted objects as Gaussian splats and optional GLB meshes. SAM 3D Body reconstructs people with body metadata and optional per-person meshes. Align combines a body mesh with an optional object mesh using the original image and can be called independently when those assets are already available.