Tomoviee AI - 图像识别 (Image Recognition)
Overview
Auto-generate masks for objects/regions in images.
API: INLINECODE0
Quick Start
Authentication
CODEBLOCK0
Python Client
CODEBLOCK1
API Usage
Basic Example
CODEBLOCK2
Parameters
- -
image (required): Image URL to analyze - INLINECODE2 : 0=edge, 1=pose, 2=subject, 3=depth
Async Workflow
- 1. Create task: Get
task_id from API call - Poll for completion: Use INLINECODE4
- Extract result: Parse returned JSON for output URLs
Status codes:
- - 1 = Queued
- 2 = Processing
- 3 = Success (ready)
- 4 = Failed
- 5 = Cancelled
- 6 = Timeout
Resources
scripts/
- -
tomoviee_image_recognition_client.py - API client - INLINECODE6 - Auth token generator
references/
See bundled reference documents for detailed API documentation and examples.
External Resources
- - Developer Portal: https://www.tomoviee.ai/developers.html
- API Documentation: https://www.tomoviee.ai/doc/
- Get API Credentials: Register at developer portal
技能名称: tomoviee-recognition
Tomoviee AI - 图像识别
概述
自动为图像中的对象/区域生成遮罩。
API: tmreferenceimg2mask
快速开始
身份验证
bash
python scripts/generateauthtoken.py YOURAPPKEY YOURAPPSECRET
Python 客户端
python
from scripts.tomovieeimagerecognition_client import TomovieeClient
client = TomovieeClient(appkey, appsecret)
API 使用
基本示例
python
taskid = client.make_request({
image=https://example.com/photo.jpg
control_type=2 # 主体/默认
})
result = client.polluntilcomplete(task_id)
import json
output = json.loads(result[result])
参数
- - image (必填): 待分析的图像URL
- control_type: 0=边缘, 1=姿态, 2=主体, 3=深度
异步工作流
- 1. 创建任务: 从API调用获取taskid
- 轮询完成: 使用polluntilcomplete(taskid)
- 提取结果: 解析返回的JSON以获取输出URL
状态码:
- - 1 = 已排队
- 2 = 处理中
- 3 = 成功(就绪)
- 4 = 失败
- 5 = 已取消
- 6 = 超时
资源
scripts/
- - tomovieeimagerecognitionclient.py - API客户端
- generateauth_token.py - 身份验证令牌生成器
references/
请参阅附带的参考文档,获取详细的API文档和示例。
外部资源
- - 开发者门户: https://www.tomoviee.ai/developers.html
- API文档: https://www.tomoviee.ai/doc/
- 获取API凭证: 在开发者门户注册