Webhook 事件格式参考
Label Studio 包含多种类型的 webhook 事件,这些事件会在特定操作发生时触发。请参考本页详情了解每个 webhook 事件负载中包含的信息。有关如何在 Label Studio 中使用 webhook 以及设置 webhook 的详细信息,请参阅在 Label Studio 中设置 webhook。若要在 Label Studio 中创建自定义 webhook 以在特定操作发生时触发事件,请参阅在 Label Studio 中为 webhook 创建自定义事件。
从Label Studio发送的Webhooks包含以下内容:
键 | 详情 |
---|---|
action | 详细说明该事件所代表的操作。 |
project | 仅针对任务和标注事件包含。关于项目的详细信息。 |
task_number | 项目中的任务总数。 |
finished_task_number | 项目中已标注任务的总数。 |
total_predictions_number | 项目的预测总数。 |
total_annotations_number | 项目中注释、跳过任务和基准真值注释的总数。可能与已注释任务的总数不同。 |
num_tasks_with_annotations | 项目中带有标注的任务总数。不计入跳过和基准真值的标注。 |
useful_annotation_number | 项目中的注释总数。不包括跳过和基准真值注释。 |
ground_truth_number | 项目中标记为基准真值标注的注释总数。 |
skipped_annotations_number | 项目中跳过或取消的标注总数。 |
Label Studio发送到已配置webhook URL的HTTP POST负载包含您在配置webhook时设置的头部信息。
如果webhook事件是对创建或更新操作的响应,则创建实体的完整详情也会包含在有效载荷中发送。更多详细信息请参阅以下事件参考表。
任务已创建
当在Label Studio中创建任务时发送。了解如何为此事件设置webhook。
Webhook 负载详情
Webhook负载包含操作名称和一些额外的任务数据。任务相关数据与通过API创建任务时的响应中包含的数据相同。
键 | 类型 | 描述 |
---|---|---|
action | string | Name of the action. In this case, TASKS_CREATED , or if just one task was imported, TASK_CREATED . |
tasks.id | integer | 所创建任务的ID。 |
tasks.data | string | Reference to the data associated with the task. Can be a URL such as s3://path/to/bucket/image.png |
tasks.meta | JSON字典 | 如果存在,表示任务的元数据。 |
tasks.created_at | datetime | 任务创建的日期和时间。 |
tasks.updated_at | datetime | 任务最后更新的日期和时间。 |
tasks.is_labeled | boolean | 该任务是否已被标注。 |
tasks.project | integer | 任务所属的项目ID。 |
project | JSON字典 | 关于任务或任务组被添加到的项目的详细信息。 |
示例载荷
Click to expand the example payload
{
"action": "TASKS_CREATED",
"tasks": [
{
"id": 21,
"data": {
"ner": "Opossums like to be aloft \n\n\n\n\n\n in trees."
},
"meta": {},
"created_at": "2021-08-17T13:51:02.590839Z",
"updated_at": "2021-08-17T13:51:02.590873Z",
"is_labeled": false,
"overlap": 1,
"project": 2,
"file_upload": 46
},
{
"id": 22,
"data": {
"ner": "Opossums are opportunistic."
},
"meta": {},
"created_at": "2021-08-17T13:51:02.590926Z",
"updated_at": "2021-08-17T13:51:02.590941Z",
"is_labeled": false,
"overlap": 1,
"project": 2,
"file_upload": 46
},
{
"id": 23,
"data": {
"ner": "Opossums like to forage for food."
},
"meta": {},
"created_at": "2021-08-17T13:51:02.590981Z",
"updated_at": "2021-08-17T13:51:02.590995Z",
"is_labeled": false,
"overlap": 1,
"project": 2,
"file_upload": 46
}
],
"project": {
"id": 2,
"title": "New Project #2",
"description": "",
"label_config": "<View></View>",
"expert_instruction": "",
"show_instruction": false,
"show_skip_button": true,
"enable_empty_annotation": true,
"show_annotation_history": false,
"show_collab_predictions": true,
"evaluate_predictions_automatically": false,
"token": "9105a1d897e52286",
"result_count": 0,
"color": "#FFFFFF",
"maximum_annotations": 1,
"min_annotations_to_start_training": 10,
"control_weights": {},
"model_version": "",
"data_types": {},
"is_draft": false,
"is_published": false,
"created_at": "2021-08-17T13:49:34.326416Z",
"updated_at": "2021-08-17T13:49:35.911271Z",
"sampling": "Sequential sampling",
"show_ground_truth_first": true,
"show_overlap_first": true,
"overlap_cohort_percentage": 100,
"task_data_login": null,
"task_data_password": null,
"organization": 1,
"created_by": 1
}
}
任务已删除
当任务从Label Studio中删除时发送。了解如何为此事件设置webhook。
Webhook 负载详情
键 | 类型 | 描述 |
---|---|---|
action | string | Name of the action. In this case, TASK_DELETED or TASKS_DELETED if multiple tasks were deleted at once. |
id | integer | 被删除任务的ID。 |
project | JSON字典 | 关于从中删除任务的项目详情。 |
示例载荷
Click to expand the example payload
{
"action": "TASKS_DELETED",
"tasks": [
{
"id": 18
},
{
"id": 19
},
{
"id": 20
},
{
"id": 21
},
{
"id": 22
},
{
"id": 23
}
],
"project": {
"id": 2,
"title": "New Project #2",
"description": "",
"label_config": "<View> <Header value=\"Please read the passage\"/> <Text name=\"text\" value=\"$ner\" granularity=\"word\"/> <Header value=\"Select a text span answering the following question:\"/> <Text name=\"question\" value=\"$ner\"/>\n<Labels name=\"answer\" toName=\"text\"> <Label value=\"Answer\" maxUsage=\"1\" background=\"red\"/> </Labels>\n</View><!-- {\"data\": { \"text\": \"The boundary of the region from which no escape is possible is called the event horizon. Although the event horizon has an enormous effect on the fate and circumstances of an object crossing it, according to general relativity it has no locally detectable features.[4] In many ways, a black hole acts like an ideal black body, as it reflects no light.[5][6] Moreover, quantum field theory in curved spacetime predicts that event horizons emit Hawking radiation, with the same spectrum as a black body of a temperature inversely proportional to its mass. This temperature is on the order of billionths of a kelvin for black holes of stellar mass, making it essentially impossible to observe directly.\", \"question\": \"How could black holes be detected?\" }, \"annotations\": [{\"result\": [ { \"value\": { \"start\": 423, \"end\": 553, \"text\": \"event horizons emit Hawking radiation, with the same spectrum as a black body of a temperature inversely proportional to its mass.\", \"labels\": [ \"Answer\" ] }, \"id\": \"b0wKkdnnRc\", \"from_name\": \"answer\", \"to_name\": \"text\", \"type\": \"labels\" } ] }] } -->",
"expert_instruction": "",
"show_instruction": false,
"show_skip_button": true,
"enable_empty_annotation": true,
"show_annotation_history": false,
"show_collab_predictions": true,
"evaluate_predictions_automatically": false,
"token": "9105a1d897e52286",
"result_count": 0,
"color": "#FFFFFF",
"maximum_annotations": 1,
"min_annotations_to_start_training": 10,
"control_weights": {
"answer": {
"overall": 1.0,
"type": "Labels",
"labels": {
"Answer": 1.0
}
}
},
"model_version": "",
"data_types": {
"ner": "Text"
},
"is_draft": false,
"is_published": false,
"created_at": "2021-08-17T13:49:34.326416Z",
"updated_at": "2021-08-17T13:52:09.334425Z",
"sampling": "Sequential sampling",
"show_ground_truth_first": true,
"show_overlap_first": true,
"overlap_cohort_percentage": 100,
"task_data_login": null,
"task_data_password": null,
"organization": 1,
"created_by": 1
}
}
标注已创建
当在Label Studio中为任务创建注释时发送。了解如何为此事件设置webhook。
Webhook 负载详情
Webhook负载包含操作名称和一些额外的标注数据。与标注相关的数据与通过API创建标注时的响应中包含的数据相同。
键 | 类型 | 描述 |
---|---|---|
action | string | Name of the action. In this case, ANNOTATION_CREATED . |
annotation.id | integer | 所创建标注的ID。 |
annotation.result | JSON字典 | 所创建标注的JSON表示形式。 |
annotation.task | integer | 该标注所对应的任务ID。 |
annotation.completed_by | integer | 创建该标注的用户ID。 |
annotation.was_cancelled | boolean | 该标注是否是由于跳过任务而产生的空标注结果。 |
annotation.ground_truth | boolean | 始终为false。表示该标注是否为基准真值。 |
annotation.created_at | datetime | 标注创建时的日期和时间。 |
annotation.updated_at | datetime | 标注最后更新的日期和时间。 |
annotation.lead_time | floating point number | 完成标注所花费的时间,单位为秒。 |
annotation.prediction | JSON字典 | 标注时查看的预测详情(如果存在预测)。 |
project | JSON字典 | 与关联项目相关的所有字段。 |
示例载荷
Click to expand the example payload
{
"action": "ANNOTATION_CREATED",
"annotation": {
"id": 17,
"result": [
{
"value": {
"start": 0,
"end": 26,
"text": "Opossums are op",
"labels": [
"Answer"
]
},
"id": "WArqkkifYE",
"from_name": "answer",
"to_name": "text",
"type": "labels"
}
],
"was_cancelled": false,
"ground_truth": false,
"created_at": "2021-08-17T13:52:48.536303Z",
"updated_at": "2021-08-17T13:52:48.536370Z",
"lead_time": 37.13,
"prediction": {},
"result_count": 0,
"task": 19,
"completed_by": 1
},
"project": {
"id": 2,
"title": "New Project #2",
"description": "",
"label_config": "<View> <Header value=\"Please read the passage\"/> <Text name=\"text\" value=\"$ner\" granularity=\"word\"/> <Header value=\"Select a text span answering the following question:\"/> <Text name=\"question\" value=\"$ner\"/>\n<Labels name=\"answer\" toName=\"text\"> <Label value=\"Answer\" maxUsage=\"1\" background=\"red\"/> </Labels>\n</View><!-- {\"data\": { \"text\": \"The boundary of the region from which no escape is possible is called the event horizon. Although the event horizon has an enormous effect on the fate and circumstances of an object crossing it, according to general relativity it has no locally detectable features.[4] In many ways, a black hole acts like an ideal black body, as it reflects no light.[5][6] Moreover, quantum field theory in curved spacetime predicts that event horizons emit Hawking radiation, with the same spectrum as a black body of a temperature inversely proportional to its mass. This temperature is on the order of billionths of a kelvin for black holes of stellar mass, making it essentially impossible to observe directly.\", \"question\": \"How could black holes be detected?\" }, \"annotations\": [{\"result\": [ { \"value\": { \"start\": 423, \"end\": 553, \"text\": \"event horizons emit Hawking radiation, with the same spectrum as a black body of a temperature inversely proportional to its mass.\", \"labels\": [ \"Answer\" ] }, \"id\": \"b0wKkdnnRc\", \"from_name\": \"answer\", \"to_name\": \"text\", \"type\": \"labels\" } ] }] } -->",
"expert_instruction": "",
"show_instruction": false,
"show_skip_button": true,
"enable_empty_annotation": true,
"show_annotation_history": false,
"show_collab_predictions": true,
"evaluate_predictions_automatically": false,
"token": "9105a1d897e52286",
"result_count": 0,
"color": "#FFFFFF",
"maximum_annotations": 1,
"min_annotations_to_start_training": 10,
"control_weights": {
"answer": {
"overall": 1.0,
"type": "Labels",
"labels": {
"Answer": 1.0
}
}
},
"model_version": "",
"data_types": {
"ner": "Text"
},
"is_draft": false,
"is_published": false,
"created_at": "2021-08-17T13:49:34.326416Z",
"updated_at": "2021-08-17T13:52:09.334425Z",
"sampling": "Sequential sampling",
"show_ground_truth_first": true,
"show_overlap_first": true,
"overlap_cohort_percentage": 100,
"task_data_login": null,
"task_data_password": null,
"organization": 1,
"created_by": 1
}
}
标注已更新
当标注更新时发送。了解如何为此事件设置webhook。
Webhook 负载详情
Webhook负载包含操作名称和一些额外的标注数据。与标注相关的数据与通过API更新标注时的响应中包含的数据相同。
键 | 类型 | 描述 |
---|---|---|
action | string | Name of the action. In this case, ANNOTATION_UPDATED . |
annotation.id | integer | 更新后的标注ID。 |
annotation.result | JSON字典 | 更新后的标注结果的JSON表示。 |
annotation.task | integer | 该标注所更新的任务ID。 |
annotation.completed_by | integer | 更新该标注的用户ID。 |
annotation.was_cancelled | boolean | 标注是否是由于跳过任务而产生的空标注结果。 |
annotation.ground_truth | boolean | 始终为false。表示该标注是否为基准真值。 |
annotation.created_at | datetime | 标注创建时的日期和时间。 |
annotation.updated_at | datetime | 标注最后更新的日期和时间。 |
annotation.lead_time | 浮点数 | 完成标注所花费的时间,单位为秒。 |
annotation.prediction | JSON字典 | 标注时查看的预测详情(如果存在预测)。 |
project | JSON字典 | 与关联项目相关的所有字段。 |
示例载荷
Click to expand the example payload
{
"action": "ANNOTATION_UPDATED",
"annotation": {
"id": 16,
"result": [
{
"original_width": 1024,
"original_height": 1024,
"image_rotation": 0,
"value": {
"x": 42,
"y": 36.4,
"width": 50.13333333333333,
"height": 26,
"rotation": 0,
"rectanglelabels": [
"Airplane"
]
},
"id": "5dC-jDgBtG",
"from_name": "label",
"to_name": "image",
"type": "rectanglelabels"
},
{
"original_width": 1024,
"original_height": 1024,
"image_rotation": 0,
"value": {
"x": 12.533333333333333,
"y": 37.733333333333334,
"width": 23.6,
"height": 22,
"rotation": 0,
"rectanglelabels": [
"Car"
]
},
"id": "_bJsGZ0_Cm",
"from_name": "label",
"to_name": "image",
"type": "rectanglelabels"
}
],
"was_cancelled": false,
"ground_truth": false,
"created_at": "2021-08-17T13:35:59.817086Z",
"updated_at": "2021-08-17T13:37:25.805479Z",
"lead_time": 299.327,
"prediction": {},
"result_count": 0,
"task": 5,
"completed_by": 1
},
"project": {
"id": 1,
"title": "New Project #5",
"description": "",
"label_config": "<View> <Image name=\"image\" value=\"$image\"/> <RectangleLabels name=\"label\" toName=\"image\"> <Label value=\"Airplane\" background=\"green\"/> <Label value=\"Car\" background=\"blue\"/> </RectangleLabels> </View>\n<!--{\"annotations\": [{\"result\": [ { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 4.21455938697318, \"y\": 11.142857142857142, \"width\": 32.95019157088122, \"height\": 46.285714285714285, \"rotation\": 0, \"rectanglelabels\": [ \"Airplane\" ] }, \"id\": \"PIhJM1YYpH\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 30.076628352490417, \"y\": 44.57142857142857, \"width\": 32.56704980842912, \"height\": 46, \"rotation\": 0, \"rectanglelabels\": [ \"Airplane\" ] }, \"id\": \"lnimBBYxMU\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 67.17850287907869, \"y\": 18, \"width\": 28.406909788867566, \"height\": 43.714285714285715, \"rotation\": 0, \"rectanglelabels\": [ \"Airplane\" ] }, \"id\": \"sBjX3KteGU\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 77.01149425287356, \"y\": 84.57142857142857, \"width\": 3.4482758620689653, \"height\": 5.142857142857142, \"rotation\": 0, \"rectanglelabels\": [ \"Car\" ] }, \"id\": \"TIYiC1Bh67\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 85.02879078694816, \"y\": 83.71428571428572, \"width\": 2.879078694817658, \"height\": 4.857142857142856, \"rotation\": 0, \"rectanglelabels\": [ \"Car\" ] }, \"id\": \"mL8hEBkvJt\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 57.08812260536399, \"y\": 87.42857142857143, \"width\": 5.363984674329502, \"height\": 7.142857142857142, \"rotation\": 0, \"rectanglelabels\": [ \"Car\" ] }, \"id\": \"3gpRfF9MkN\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" } ] }]} -->",
"expert_instruction": "",
"show_instruction": false,
"show_skip_button": true,
"enable_empty_annotation": true,
"show_annotation_history": false,
"show_collab_predictions": true,
"evaluate_predictions_automatically": false,
"token": "846c4da585704dd4",
"result_count": 0,
"color": "#F6C549",
"maximum_annotations": 1,
"min_annotations_to_start_training": 10,
"control_weights": {
"label": {
"overall": 1.0,
"type": "RectangleLabels",
"labels": {
"Airplane": 1.0,
"Car": 1.0
}
}
},
"model_version": "",
"data_types": {
"image": "Image"
},
"is_draft": false,
"is_published": false,
"created_at": "2021-08-12T14:15:01.744507Z",
"updated_at": "2021-08-17T13:35:25.697471Z",
"sampling": "Sequential sampling",
"show_ground_truth_first": true,
"show_overlap_first": true,
"overlap_cohort_percentage": 100,
"task_data_login": null,
"task_data_password": null,
"organization": 1,
"created_by": 1
}
}
标注已删除
在删除标注时发送。了解如何为此事件设置webhook。
Webhook 负载详情
键 | 类型 | 描述 |
---|---|---|
action | string | Name of the action. In this case, ANNOTATION_DELETED , or for bulk actions, ANNOTATIONS_DELETED |
id | integer | 被删除标注的ID。 |
project | JSON字典 | 关于从中删除注释的项目详情。 |
示例负载
Click to expand the example payload
{
"action": "ANNOTATIONS_DELETED",
"annotations": [
{
"id": 17
}
],
"project": {
"id": 2,
"title": "New Project #2",
"description": "",
"label_config": "<View> <Header value=\"Please read the passage\"/> <Text name=\"text\" value=\"$ner\" granularity=\"word\"/> <Header value=\"Select a text span answering the following question:\"/> <Text name=\"question\" value=\"$ner\"/>\n<Labels name=\"answer\" toName=\"text\"> <Label value=\"Answer\" maxUsage=\"1\" background=\"red\"/> </Labels>\n</View><!-- {\"data\": { \"text\": \"The boundary of the region from which no escape is possible is called the event horizon. Although the event horizon has an enormous effect on the fate and circumstances of an object crossing it, according to general relativity it has no locally detectable features.[4] In many ways, a black hole acts like an ideal black body, as it reflects no light.[5][6] Moreover, quantum field theory in curved spacetime predicts that event horizons emit Hawking radiation, with the same spectrum as a black body of a temperature inversely proportional to its mass. This temperature is on the order of billionths of a kelvin for black holes of stellar mass, making it essentially impossible to observe directly.\", \"question\": \"How could black holes be detected?\" }, \"annotations\": [{\"result\": [ { \"value\": { \"start\": 423, \"end\": 553, \"text\": \"event horizons emit Hawking radiation, with the same spectrum as a black body of a temperature inversely proportional to its mass.\", \"labels\": [ \"Answer\" ] }, \"id\": \"b0wKkdnnRc\", \"from_name\": \"answer\", \"to_name\": \"text\", \"type\": \"labels\" } ] }] } -->",
"expert_instruction": "",
"show_instruction": false,
"show_skip_button": true,
"enable_empty_annotation": true,
"show_annotation_history": false,
"show_collab_predictions": true,
"evaluate_predictions_automatically": false,
"token": "9105a1d897e52286",
"result_count": 0,
"color": "#FFFFFF",
"maximum_annotations": 1,
"min_annotations_to_start_training": 10,
"control_weights": {
"answer": {
"overall": 1.0,
"type": "Labels",
"labels": {
"Answer": 1.0
}
}
},
"model_version": "",
"data_types": {
"ner": "Text"
},
"is_draft": false,
"is_published": false,
"created_at": "2021-08-17T13:49:34.326416Z",
"updated_at": "2021-08-17T13:52:09.334425Z",
"sampling": "Sequential sampling",
"show_ground_truth_first": true,
"show_overlap_first": true,
"overlap_cohort_percentage": 100,
"task_data_login": null,
"task_data_password": null,
"organization": 1,
"created_by": 1
}
}
项目已创建
在项目创建时发送。了解如何为此事件设置webhook。
要使用此事件,您必须启用组织级webhooks。
Webhook 负载详情
Webhook负载包含操作名称和一些额外的项目数据。与项目相关的数据与通过API创建项目时的响应中包含的数据相同。
键 | 类型 | 描述 |
---|---|---|
action | string | The action that triggered the event. In this case, PROJECT_CREATED . |
project | JSON字典 | 与所创建项目相关的所有字段。请参阅创建项目的API文档。 |
示例载荷
Click to expand the example payload
{
"action": "PROJECT_CREATED",
"project": {
"id": 3,
"title": "New Project #3",
"description": "",
"label_config": "<View></View>",
"expert_instruction": "",
"show_instruction": false,
"show_skip_button": true,
"enable_empty_annotation": true,
"show_annotation_history": false,
"show_collab_predictions": true,
"evaluate_predictions_automatically": false,
"token": "d881a308198ff9ac",
"result_count": 0,
"color": "#FFFFFF",
"maximum_annotations": 1,
"min_annotations_to_start_training": 10,
"control_weights": {},
"model_version": "",
"data_types": {},
"is_draft": false,
"is_published": false,
"created_at": "2021-08-17T13:55:58.809065Z",
"updated_at": "2021-08-17T13:55:58.809098Z",
"sampling": "Sequential sampling",
"show_ground_truth_first": true,
"show_overlap_first": true,
"overlap_cohort_percentage": 100,
"task_data_login": null,
"task_data_password": null,
"organization": 1,
"created_by": 1
}
}
项目已更新
当项目更新时发送。了解如何为此事件设置webhook。
Webhook 负载详情
Webhook负载包含操作名称和一些额外的项目数据。项目相关数据与通过API更新项目时的响应中包含的数据相同。
键 | 类型 | 描述 |
---|---|---|
action | string | The action that triggered the event. In this case, PROJECT_UPDATED . |
project | JSON字典 | 与更新项目相关的所有字段。请参阅更新项目的API文档。 |
示例载荷
Click to expand the example payload
{
"action": "PROJECT_UPDATED",
"project": {
"id": 1,
"title": "New Project #5",
"description": "",
"label_config": "<View> <Image name=\"image\" value=\"$image\"/> <RectangleLabels name=\"label\" toName=\"image\"> <Label value=\"Airplane\" background=\"green\"/> <Label value=\"Car\" background=\"blue\"/> </RectangleLabels> </View>\n<!--{\"annotations\": [{\"result\": [ { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 4.21455938697318, \"y\": 11.142857142857142, \"width\": 32.95019157088122, \"height\": 46.285714285714285, \"rotation\": 0, \"rectanglelabels\": [ \"Airplane\" ] }, \"id\": \"PIhJM1YYpH\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 30.076628352490417, \"y\": 44.57142857142857, \"width\": 32.56704980842912, \"height\": 46, \"rotation\": 0, \"rectanglelabels\": [ \"Airplane\" ] }, \"id\": \"lnimBBYxMU\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 67.17850287907869, \"y\": 18, \"width\": 28.406909788867566, \"height\": 43.714285714285715, \"rotation\": 0, \"rectanglelabels\": [ \"Airplane\" ] }, \"id\": \"sBjX3KteGU\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 77.01149425287356, \"y\": 84.57142857142857, \"width\": 3.4482758620689653, \"height\": 5.142857142857142, \"rotation\": 0, \"rectanglelabels\": [ \"Car\" ] }, \"id\": \"TIYiC1Bh67\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 85.02879078694816, \"y\": 83.71428571428572, \"width\": 2.879078694817658, \"height\": 4.857142857142856, \"rotation\": 0, \"rectanglelabels\": [ \"Car\" ] }, \"id\": \"mL8hEBkvJt\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" }, { \"original_width\": 600, \"original_height\": 403, \"image_rotation\": 0, \"value\": { \"x\": 57.08812260536399, \"y\": 87.42857142857143, \"width\": 5.363984674329502, \"height\": 7.142857142857142, \"rotation\": 0, \"rectanglelabels\": [ \"Car\" ] }, \"id\": \"3gpRfF9MkN\", \"from_name\": \"label\", \"to_name\": \"image\", \"type\": \"rectanglelabels\" } ] }]} -->",
"expert_instruction": "",
"show_instruction": false,
"show_skip_button": true,
"enable_empty_annotation": true,
"show_annotation_history": false,
"show_collab_predictions": true,
"evaluate_predictions_automatically": false,
"token": "846c4da585704dd4",
"result_count": 0,
"color": "#F6C549",
"maximum_annotations": 1,
"min_annotations_to_start_training": 10,
"control_weights": {
"label": {
"overall": 1.0,
"type": "RectangleLabels",
"labels": {
"Airplane": 1.0,
"Car": 1.0
}
}
},
"model_version": "",
"data_types": {
"image": "Image"
},
"is_draft": false,
"is_published": false,
"created_at": "2021-08-12T14:15:01.744507Z",
"updated_at": "2021-08-17T13:39:14.054849Z",
"sampling": "Sequential sampling",
"show_ground_truth_first": true,
"show_overlap_first": true,
"overlap_cohort_percentage": 100,
"task_data_login": null,
"task_data_password": null,
"organization": 1,
"created_by": 1
}
}
项目已删除
在项目被删除时发送。了解如何为此事件设置webhook。
你必须启用组织级Webhooks才能使用此事件。
Webhook 负载详情
键 | 类型 | 描述 |
---|---|---|
action | string | Name of the action. In this case, PROJECT_DELETED . |
id | integer | 已删除项目的ID。 |
示例载荷
{
"action": "PROJECT_DELETED",
"project": {
"id": 3
}
}
开始训练
当用户在项目设置页面的ML模型卡片上点击Start Training
按钮时,将触发此webhook。
该事件将被发送到ML后端,并可在model.fit(event, …)方法中捕获:
class MyModel(LabelStudioMLBase):
def fit(self, event, *args, **kwargs):
if event == 'START_TRAINING':
...
Webhook 负载详情
键 | 类型 | 描述 |
---|---|---|
action | string | Name of the action: START_TRAINING . |
id | integer | 启动训练的项目ID。 |
project | JSON字典 | 与更新项目相关的所有字段。请参阅更新项目的API文档。 |