zf-kbot/md-me-sam3
Public
44.6K
runs
Run zf-kbot/md-me-sam3 with an API
Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.
Input schema
The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.
| Field | Type | Default value | Description |
|---|---|---|---|
| image |
string
|
输入图像
|
|
| prompt_type |
None
|
auto
|
交互类型:point(L1单击/L3点精修) / box(框选) / text(L2文字批量) / exemplar(L4相似查找) / auto(L0自动主体)
|
| points |
string
|
点坐标 JSON:[[x,y,label],...],label 1=前景 0=背景。例:[[512,300,1],[220,110,0]]
|
|
| boxes |
string
|
框坐标 JSON:[[x1,y1,x2,y2],...]。box 取第一个;exemplar 用作示例框。
|
|
| text_prompt |
string
|
文字 prompt(名词短语),用于 text 模式开放词汇分割,如 "person" / "red car"
|
|
| include_held_objects |
boolean
|
False
|
自动判断人物手持物品并合并到相邻人物蒙版;额外运行视觉识别,可能漏选或误选。默认关闭。
|
| multimask |
boolean
|
True
|
point 模式是否返回 Top-3 候选(局部/对象/整体)
|
| use_cache |
boolean
|
True
|
复用该图 Embedding 缓存(同图精修/换 prompt 时强烈建议开启)
|
| max_instances |
integer
|
50
Min: 1 Max: 300 |
返回实例上限(text/exemplar 多实例时截断)
|
| confidence_threshold |
number
|
0.5
Max: 1 |
候选实例置信度阈值;降低可增加召回,也可能增加误选。不改变蒙版像素阈值。
|
| output_format |
None
|
rle
|
蒙版导出格式:rle(紧凑,默认) / svg(矢量路径) / both
|
| feather |
integer
|
0
Max: 50 |
边缘羽化强度(像素),0=不羽化
|
| fill_holes |
boolean
|
False
|
填补蒙版内部孔洞
|
| despeckle |
integer
|
0
|
移除小于该面积(像素)的碎块,0=不处理
|
| include_preview |
boolean
|
True
|
输出合成预览 PNG
|
{
"type": "object",
"title": "Input",
"required": [
"image"
],
"properties": {
"boxes": {
"type": "string",
"title": "Boxes",
"x-order": 3,
"nullable": true,
"description": "\u6846\u5750\u6807 JSON\uff1a[[x1,y1,x2,y2],...]\u3002box \u53d6\u7b2c\u4e00\u4e2a\uff1bexemplar \u7528\u4f5c\u793a\u4f8b\u6846\u3002"
},
"image": {
"type": "string",
"title": "Image",
"format": "uri",
"x-order": 0,
"description": "\u8f93\u5165\u56fe\u50cf"
},
"points": {
"type": "string",
"title": "Points",
"x-order": 2,
"nullable": true,
"description": "\u70b9\u5750\u6807 JSON\uff1a[[x,y,label],...]\uff0clabel 1=\u524d\u666f 0=\u80cc\u666f\u3002\u4f8b\uff1a[[512,300,1],[220,110,0]]"
},
"feather": {
"type": "integer",
"title": "Feather",
"default": 0,
"maximum": 50,
"minimum": 0,
"x-order": 11,
"description": "\u8fb9\u7f18\u7fbd\u5316\u5f3a\u5ea6(\u50cf\u7d20)\uff0c0=\u4e0d\u7fbd\u5316"
},
"despeckle": {
"type": "integer",
"title": "Despeckle",
"default": 0,
"minimum": 0,
"x-order": 13,
"description": "\u79fb\u9664\u5c0f\u4e8e\u8be5\u9762\u79ef(\u50cf\u7d20)\u7684\u788e\u5757\uff0c0=\u4e0d\u5904\u7406"
},
"multimask": {
"type": "boolean",
"title": "Multimask",
"default": true,
"x-order": 6,
"description": "point \u6a21\u5f0f\u662f\u5426\u8fd4\u56de Top-3 \u5019\u9009\uff08\u5c40\u90e8/\u5bf9\u8c61/\u6574\u4f53\uff09"
},
"use_cache": {
"type": "boolean",
"title": "Use Cache",
"default": true,
"x-order": 7,
"description": "\u590d\u7528\u8be5\u56fe Embedding \u7f13\u5b58\uff08\u540c\u56fe\u7cbe\u4fee/\u6362 prompt \u65f6\u5f3a\u70c8\u5efa\u8bae\u5f00\u542f\uff09"
},
"fill_holes": {
"type": "boolean",
"title": "Fill Holes",
"default": false,
"x-order": 12,
"description": "\u586b\u8865\u8499\u7248\u5185\u90e8\u5b54\u6d1e"
},
"prompt_type": {
"enum": [
"point",
"box",
"text",
"exemplar",
"auto"
],
"type": "string",
"title": "prompt_type",
"description": "\u4ea4\u4e92\u7c7b\u578b\uff1apoint(L1\u5355\u51fb/L3\u70b9\u7cbe\u4fee) / box(\u6846\u9009) / text(L2\u6587\u5b57\u6279\u91cf) / exemplar(L4\u76f8\u4f3c\u67e5\u627e) / auto(L0\u81ea\u52a8\u4e3b\u4f53)",
"default": "auto",
"x-order": 1
},
"text_prompt": {
"type": "string",
"title": "Text Prompt",
"x-order": 4,
"nullable": true,
"description": "\u6587\u5b57 prompt\uff08\u540d\u8bcd\u77ed\u8bed\uff09\uff0c\u7528\u4e8e text \u6a21\u5f0f\u5f00\u653e\u8bcd\u6c47\u5206\u5272\uff0c\u5982 \"person\" / \"red car\""
},
"max_instances": {
"type": "integer",
"title": "Max Instances",
"default": 50,
"maximum": 300,
"minimum": 1,
"x-order": 8,
"description": "\u8fd4\u56de\u5b9e\u4f8b\u4e0a\u9650\uff08text/exemplar \u591a\u5b9e\u4f8b\u65f6\u622a\u65ad\uff09"
},
"output_format": {
"enum": [
"rle",
"svg",
"both"
],
"type": "string",
"title": "output_format",
"description": "\u8499\u7248\u5bfc\u51fa\u683c\u5f0f\uff1arle(\u7d27\u51d1,\u9ed8\u8ba4) / svg(\u77e2\u91cf\u8def\u5f84) / both",
"default": "rle",
"x-order": 10
},
"include_preview": {
"type": "boolean",
"title": "Include Preview",
"default": true,
"x-order": 14,
"description": "\u8f93\u51fa\u5408\u6210\u9884\u89c8 PNG"
},
"confidence_threshold": {
"type": "number",
"title": "Confidence Threshold",
"default": 0.5,
"maximum": 1,
"minimum": 0,
"x-order": 9,
"description": "\u5019\u9009\u5b9e\u4f8b\u7f6e\u4fe1\u5ea6\u9608\u503c\uff1b\u964d\u4f4e\u53ef\u589e\u52a0\u53ec\u56de\uff0c\u4e5f\u53ef\u80fd\u589e\u52a0\u8bef\u9009\u3002\u4e0d\u6539\u53d8\u8499\u7248\u50cf\u7d20\u9608\u503c\u3002"
},
"include_held_objects": {
"type": "boolean",
"title": "Include Held Objects",
"default": false,
"x-order": 5,
"description": "\u81ea\u52a8\u5224\u65ad\u4eba\u7269\u624b\u6301\u7269\u54c1\u5e76\u5408\u5e76\u5230\u76f8\u90bb\u4eba\u7269\u8499\u7248\uff1b\u989d\u5916\u8fd0\u884c\u89c6\u89c9\u8bc6\u522b\uff0c\u53ef\u80fd\u6f0f\u9009\u6216\u8bef\u9009\u3002\u9ed8\u8ba4\u5173\u95ed\u3002"
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
Schema
{
"type": "object",
"title": "Output",
"required": [
"masks_json",
"num_instances",
"cache_hit",
"gpu_ms",
"latency_ms"
],
"properties": {
"gpu_ms": {
"type": "number",
"title": "Gpu Ms"
},
"cache_hit": {
"type": "boolean",
"title": "Cache Hit"
},
"latency_ms": {
"type": "number",
"title": "Latency Ms"
},
"masks_json": {
"type": "string",
"title": "Masks Json"
},
"combined_mask": {
"type": "string",
"title": "Combined Mask",
"format": "uri",
"nullable": true
},
"num_instances": {
"type": "integer",
"title": "Num Instances"
}
}
}