QuerySmarttagJob

更新时间:
复制 MD 格式

Queries a DataQ - Smart Tag Service job.

Operation description

  • This operation returns the results of an intelligent analysis of people, scenes, and keywords in videos.

  • The DataQ - Smart Tag Service is available only in the China North 2 (Beijing), China East 2 (Shanghai), and China East 1 (Hangzhou) regions.

QPS limit

The maximum number of queries per second (QPS) for this operation is 100 per user. If this limit is exceeded, rate limiting is triggered, which may affect your business. For more information, see QPS limits.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

mts:QuerySmarttagJob

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

JobId

string

Yes

The ID of the DataQ - Smart Tag Service job to query. Get this value from the response of SubmitSmarttagJob.

39f8e0bc005e4f309379701645f4****

Params

string

No

Additional request parameters as a JSON string. For example: {"labelResultType":"auto"}. The labelResultType parameter is a string with these values:

  • auto: Machine-generated tags

  • hmi: Human-machine collaborative tags

{"labelResultType":"auto"}

Response elements

Element

Type

Description

Example

object

Response parameters.

JobStatus

string

The job status. Valid values:

  • Success: The job succeeded.

  • Fail: The job failed.

  • Processing: The job is running.

  • Submitted: The job was submitted and is waiting to run.

Success

Message

string

RequestId

string

The request ID.

7B117AF5-2A16-412C-B127-FA6175ED1AD0

Results

object

Result

array<object>

An array of analysis result objects.

object

Detailed information about each analysis result object.

Data

string

The specific analysis result, formatted as a JSON string. For the structure of different Type values, see Result parameter description below.

{"title":"example-title-****"}

Type

string

The type of analysis result.

  • Tag 1.0 result types:

    • TextLabel: Text labels

    • VideoLabel: Video labels

    • ASR: Raw speech recognition results (not returned by default)

    • OCR: Raw OCR results (not returned by default)

    • Process: Link to the raw algorithm result JSON file (not returned by default). For the JSON structure, see Additional notes.

  • Tag 2.0 result types:

    • CPVLabel (human-machine)

    • Meta: Video title and other metadata (not returned by default)

  • Tag 2.0-custom result types:

    • CPVLabel (human-machine)

    • Meta: Video title and other metadata (not returned by default)

Meta

UserData

string

Information passed through when using MNS callbacks. For the message format, see Callback message format definition below.

example UserData ****

Callback message format

When the state of a DataQ - Smart Tag Service job changes, ApsaraVideo Media Processing (MPS) sends a message to the queue that you specify. You can call the UpdatePipeline operation to specify the callback queue. The message body is a JSON string that contains the following fields:

NameTypeDescription
TypeStringThe fixed string "smarttag", indicating a DataQ - Smart Tag Service job
JobIdStringThe unique job ID
StateStringThe current job status. This matches the JobStatus value in QuerySmarttagJob.
UserDataStringThe UserData value you passed in SubmitSmarttagJob.

Result parameter description

VideoLabel data structure

NameTypeDescription
personsJSONArrayDetected people
persons.nameStringThe detected person's name
persons.categoryStringThe person's category. Valid values: celebrity (celebrity); politician (politician); sensitive (sensitive person); unknown (unknown person); or a custom person library ID (returned if the person is in your custom library)
persons.ratiodoubleThe person's appearance ratio. Valid values: 0 to 1
persons.occurrencesJSONArrayDetailed occurrence information
persons.occurrences.scoredoubleConfidence score
persons.occurrences.fromdoubleStart time of the person's appearance, in seconds
persons.occurrences.todoubleEnd time of the person's appearance, in seconds
persons.occurrences.positionJSONObjectFace coordinates
persons.occurrences.position.leftTopint[]x and y coordinates of the top-left corner
persons.occurrences.position.rightBottomint[]x and y coordinates of the bottom-right corner
persons.occurrences.timestampdoubleTimestamp of the face coordinates, in seconds
persons.occurrences.sceneStringShot type. Valid values: closeUp (close-up); medium-closeUp (medium close-up); medium (medium shot); medium-long (long shot)
tagsJSONArrayDetected object and scene labels. See the table below for examples.
tags.mainTagNameStringMain tag
tags.subTagNameStringSubtag
tags.ratiodoubleAppearance ratio. Valid values: 0 to 1
tags.occurrencesJSONArrayOccurrence details
tags.occurrences.scoredoubleConfidence score
tags.occurrences.fromdoubleStart time, in seconds
tags.occurrences.todoubleEnd time, in seconds
classificationsJSONArrayVideo classification information
classifications.scoredoubleConfidence score
classifications.category1StringLevel 1 category, such as Life, Animation, or Automobile
classifications.category2StringLevel 2 category, such as Health or Home under Life

Example video tags

mainTagNamesubTagName
ProgramFor example: Where Are We Going, Dad? or Happy Comedians
CharacterFor example: doctor, nurse, or teacher
ObjectFor example: piano, water glass, table, tomato and egg stir-fry, car, or cosmetics
LogoFor example: CCTV1, CCTV2, Youku, or Dragon TV
Action or eventFor example: dancing, kissing, hugging, meeting, singing, making a phone call, horseback riding, or fighting
RegionFor example: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, or United States
SceneFor example: bedroom, subway station, terraced fields, beach, or desert

ImageLabel data structure

NameTypeDescription
personsJSONArrayDetected people
persons.nameStringThe detected person's name
persons.categoryStringThe person's category. Valid values: celebrity (celebrity); politician (politician); sensitive (sensitive person)
persons.scoredoubleConfidence score for the person
persons.positionJSONObjectFace coordinates
persons.position.leftTopint[]x and y coordinates of the top-left corner
persons.position.rightBottomint[]x and y coordinates of the bottom-right corner
persons.sceneStringShot type. Valid values: closeUp (close-up); medium-closeUp (medium close-up); medium (medium shot); medium-long (long shot)
tagsJSONArrayDetected object and scene labels. See the table below for examples.
tags.mainTagNameStringMain tag
tags.subTagNameStringSubtag
tags.scoredoubleConfidence score

Example image tags

mainTagNamesubTagName
CharacterFor example: doctor, nurse, or teacher
RegionFor example: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, or United States
Action or eventFor example: speaking
LogoFor example: CCTV1, CCTV2, Youku, or Dragon TV
Action or eventFor example: dancing, kissing, hugging, meeting, singing, making a phone call, horseback riding, or fighting
ObjectFor example: piano, water glass, table, tomato and egg stir-fry, car, or cosmetics
SceneFor example: bedroom, subway station, terraced fields, beach, or desert

TextLabel data structure (from automatic speech recognition (ASR) and optical character recognition (OCR))

NameTypeDescription
tagsJSONArrayText label information. See the table below for examples.
tags.nameStringLabel category
tags.valueStringLabel value. Multiple values are separated by commas (,).

Example text tags

namevalue
RegionFor example: Tiananmen Square in Beijing, Statue of Liberty, Leshan Giant Buddha, China, or United States
OrganizationFor example: China Wildlife Conservation Association or China Media Group
LogoFor example: Nike or Li-Ning
KeywordFor example: backbone force

CPVLabel data structure

  • cates: Categories (level 1, level 2, and level 3)

  • entities: Category properties (with knowledge graph information)

  • hotwords: Hot words (your watchlist)

  • freeTags: Free tags (keywords)

NameTypeExample valueDescription
typeStringhmiResult type. Valid values: hmi (human-machine collaborative result) or autp (machine-generated result)
catesJSONArray-Category results
cates.labelLevel1StringTravelLevel 1 label
cates.labelLevel2StringScenic spotsLevel 2 label
cates.labelString""Label name. The algorithm may return an empty string.
cates.appearanceProbabilitydouble0.96Appearance ratio
cates.detailInfoJSONArray--
cates.detailInfo.scoredouble0.9Confidence score
cates.detailInfo.startTimedouble0.021Start time
cates.detailInfo.endTimedouble29.021End time
entitiesJSONArray--
entities.labelLevel1StringRegionLevel 1 label
entities.labelLevel2StringLandmarkLevel 2 label
entities.labelStringHuangguoshu WaterfallLabel name
entities.appearanceProbabilitydouble0.067Appearance ratio
entities.knowledgeInfoString{"name": "Huangguoshu Waterfall", "nameEn": "Huangguoshu Waterfall", "description": "One of Asia's four great waterfalls"}Knowledge graph information. All fields are listed in the tables at the end: IP Graph, Music Graph, Person Graph, Landmark Graph, and Object Graph.
entities.detailInfoJSONArray--
entities.detailInfo.scoredouble0.33292606472969055Confidence score
entities.detailInfo.startTimedouble6.021Start time
entities.detailInfo.endTimedouble8.021End time
entities.detailInfo.trackDataJSONArray-Structured entity label information
entities.detailInfo.trackData.scoredouble0.32Confidence score
entities.detailInfo.trackData.bboxinteger[]23, 43, 45, 67Bounding box
entities.detailInfo.trackData.timestampdouble7.9Timestamp
hotwordsJSONArray--
hotwords.labelLevel1StringKeywordLevel 1 label
hotwords.labelLevel1StringKeywordLevel 2 label
hotwords.labelLevel2String""Level 2 label
hotwords.labelStringChina Meteorological AdministrationHot word content
hotwords.appearanceProbabilitydouble0.96Appearance ratio
hotwords.detailInfoJSONArray
hotwords.detailInfo.scoredouble1.0Confidence score
hotwords.detailInfo.startTimedouble0.021Start time
hotwords.detailInfo.endTimedouble29.021End time
freeTagsJSONArray
freeTags.labelLevel1StringKeywordLevel 1 label
freeTags.labelLevel2String""Level 2 label
freeTags.labelStringCentral Meteorological ObservatoryHot word content
freeTags.appearanceProbabilitydouble0.96Appearance ratio
freeTags.detailInfoJSONArray
freeTags.detailInfo.scoredouble0.9Confidence score
freeTags.detailInfo.startTimedouble0.021Start time
freeTags.detailInfo.endTimedouble29.021End time

Automatic speech recognition (ASR) results

NameTypeDescription
detailsJSONArrayDetailed task results
details.fromdoubleStart timestamp, in seconds
details.todoubleEnd timestamp, in seconds
details.contentStringRecognized text content

Optical character recognition (OCR) results

NameTypeDescription
detailsJSONArrayDetailed task results
details.timestampdoubleTimestamp, in seconds
details.infoJSONArraySpecific information recognized at that timestamp
details.info.scoredoubleConfidence score
details.info.positionJSONObjectText coordinates
details.info.position.leftTopint[]x and y coordinates of the top-left corner
details.info.position.rightBottomint[]x and y coordinates of the bottom-right corner
details.info.contentStringRecognized text content
details.info.textTypeStringText type. Valid values: 0 (normal caption), 1 (scrolling caption), or 2 (fixed-length identifying caption, duration longer than 3 seconds)

Meta tagging results

Note

If you do not use human-machine tagging and set needMetaData to true in a SubmitSmarttagJob request, QuerySmarttagJob returns the original title.

NameTypeDescription
titleStringTitle

Caption extraction results

NameTypeDescription
detailsJSONArrayDetailed task results
details.allResultUrlStringURL for all captions. This URL remains valid for six months after the job completes.
details.chResultUrlStringURL for Chinese captions. This URL remains valid for six months after the job completes.
details.engResultUrlStringURL for English captions. This URL remains valid for six months after the job completes.
Note

The content of the file at the caption result URL is formatted as follows: Sequence number + Time range + Caption content (each caption on one line).

Examples

Success response

JSON format

{
  "JobStatus": "Success",
  "Message": "",
  "RequestId": "7B117AF5-2A16-412C-B127-FA6175ED1AD0",
  "Results": {
    "Result": [
      {
        "Data": "{\"title\":\"example-title-****\"}",
        "Type": "Meta"
      }
    ]
  },
  "UserData": "example UserData ****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.