视频理解
启动任务
请求参数
名称 | 类型 | 是否必须 | 说明 |
---|---|---|---|
id | String | Y | 设备通道id |
url | String | Y | RTSP流地址 |
task | String | Y | 任务名称,或者任务唯一id |
prompt | String | Y | 任务提示词 |
frame_interval | Int64 | Y | 抽帧间隔,单位ms |
model | String | Y | 指定要使用的模型名 |
batch_size | Int32 | Y | 一次推理需要的图片数 |
响应参数
名称 | 类型 | 是否必须 | 说明 |
---|---|---|---|
status | Int | Y | 状态码200为成功,其余为出错 |
message | String | Y | 当status=200为”success”, 其余为错误信息 |
data | Object | N | 返回有用的数据 |
删除任务
请求参数
名称 | 类型 | 是否必须 | 说明 |
---|---|---|---|
id | String | Y | 设备通道id |
tasks | StringArray | Y | 要删除的任务列表 |
响应参数
名称 | 类型 | 是否必须 | 说明 |
---|---|---|---|
status | Int | Y | 状态码200为成功,其余为出错 |
message | String | Y | 当status=200为”success”, 其余为错误信息 |
data | Object | N | 返回有用的数据 |
RESTFUL
启动任务
POST http://{ip:port}/uran/lm/video/task
请求示例
{
"id" : "agf1wr2",
"url" : "rtsp://admin:123ABCabc@10.10.1.102/ch1/main/av_stream",
"task" : "task2",
"prompt" : "图中是否有车辆拥堵",
"frame_interval" : 5000,
"model" : "simulator",
"batch" : 1
}
响应示例
{
"status": 200,
"message": "success"
}
删除任务
DELETE http://{ip:port}/uran/lm/video/task
请求示例
{
"id" : "agf1wr2",
"tasks" : ["task1", "task2"]
}
响应示例
{
"status": 200,
"message": "success"
}
gRPC
syntax = "proto3";
package lm_video;
service LmVideo {
rpc CreateVideoTask(LmVideoTask) returns (LmVideoResponse) {} //创建分析任务
rpc DeleteRunningTasks(LmRunningTasks) returns (LmVideoResponse) {} //删除分析任务
}
message LmVideoTask { //启动任务参数
string id = 1;
string url = 2;
string task = 3;
string prompt = 4;
string model = 5;
int64 frame_interval = 6;
int32 batch_size = 7;
}
message LmRunningTasks { //删除任务参数
string id = 1;
repeated string tasks = 2;
}
message LmVideoResponse { //响应
int32 status = 1;
string message = 2;
}