360 Secure SkillHub
360 安全技能中心

Tomoviee Image Recognition

封装 Tomoviee 图像识别 API(tm_reference_img2mask):传入图片 URL 与 control_type,生成边缘、姿态、主体或深度掩码。附带 app_key/app_secret 令牌生成脚本和 Python 客户端,采用创建任务后轮询直至完成的异步流程。

wondershare-boop
wondershare-boop
热度 67.64
最近更新 2026-05-11 17:29:21
分类:创作依赖:代码执行 / 第三方 API应用场景:图像生成 / API 集成 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add tomoviee-image-recognition
Metadata
name
tomoviee-recognition
description
Auto-generate masks for objects/regions in images. Use when users request image_recognition operations or related tasks.

Tomoviee AI - 图像识别 (Image Recognition)

Overview

Auto-generate masks for objects/regions in images.

API: tm_reference_img2mask

Quick Start

Authentication

python scripts/generate_auth_token.py YOUR_APP_KEY YOUR_APP_SECRET

Python Client

from scripts.tomoviee_image_recognition_client import TomovieeClient

client = TomovieeClient("app_key", "app_secret")

API Usage

Basic Example

task_id = client._make_request({
    image='https://example.com/photo.jpg'
    control_type='2'  # subject/default
})

result = client.poll_until_complete(task_id)
import json
output = json.loads(result['result'])

Parameters

  • image (required): Image URL to analyze
  • control_type: 0=edge, 1=pose, 2=subject, 3=depth

Async Workflow

  1. Create task: Get task_id from API call
  2. Poll for completion: Use poll_until_complete(task_id)
  3. 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
  • generate_auth_token.py - Auth token generator

references/

See bundled reference documents for detailed API documentation and examples.

External Resources