Add object classification attributes to Tracked Object Details (#21348)

* attributes endpoint

* event endpoints

* add attributes to more filters

* add to suggestions and query in explore

* support attributes in search input

* i18n

* add object type filter to endpoint

* add attributes to tracked object details pane

* add generic multi select dialog

* save object attributes endpoint

* add group by param to fetch attributes endpoint

* add attribute editing to tracked object details

* docs

* fix docs

* update openapi spec to match python
This commit is contained in:
Josh Hawkins
2025-12-18 08:35:47 -06:00
committed by GitHub
parent 074b060e9c
commit 6a0e31dcf9
18 changed files with 808 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ id: object_classification
title: Object Classification
---
Object classification allows you to train a custom MobileNetV2 classification model to run on tracked objects (persons, cars, animals, etc.) to identify a finer category or attribute for that object.
Object classification allows you to train a custom MobileNetV2 classification model to run on tracked objects (persons, cars, animals, etc.) to identify a finer category or attribute for that object. Classification results are visible in the Tracked Object Details pane in Explore, through the `frigate/tracked_object_details` MQTT topic, in Home Assistant sensors via the official Frigate integration, or through the event endpoints in the HTTP API.
## Minimum System Requirements

View File

@@ -3,7 +3,7 @@ id: state_classification
title: State Classification
---
State classification allows you to train a custom MobileNetV2 classification model on a fixed region of your camera frame(s) to determine a current state. The model can be configured to run on a schedule and/or when motion is detected in that region.
State classification allows you to train a custom MobileNetV2 classification model on a fixed region of your camera frame(s) to determine a current state. The model can be configured to run on a schedule and/or when motion is detected in that region. Classification results are available through the `frigate/<camera_name>/classification/<model_name>` MQTT topic and in Home Assistant sensors via the official Frigate integration.
## Minimum System Requirements

View File

@@ -616,6 +616,32 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/HTTPValidationError"
/classification/attributes:
get:
tags:
- Classification
summary: Get custom classification attributes
description: |-
Returns custom classification attributes for a given object type.
Only includes models with classification_type set to 'attribute'.
By default returns a flat sorted list of all attribute labels.
If group_by_model is true, returns attributes grouped by model name.
operationId: get_custom_attributes_classification_attributes_get
parameters:
- name: object_type
in: query
schema:
type: string
- name: group_by_model
in: query
schema:
type: boolean
default: false
responses:
"200":
description: Successful Response
"422":
description: Validation Error
/classification/{name}/dataset:
get:
tags:
@@ -2912,6 +2938,42 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/HTTPValidationError"
/events/{event_id}/attributes:
post:
tags:
- Events
summary: Set custom classification attributes
description: |-
Sets an event's custom classification attributes for all attribute-type
models that apply to the event's object type.
Returns a success message or an error if the event is not found.
operationId: set_attributes_events__event_id__attributes_post
parameters:
- name: event_id
in: path
required: true
schema:
type: string
title: Event Id
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/EventsAttributesBody"
responses:
"200":
description: Successful Response
content:
application/json:
schema:
$ref: "#/components/schemas/GenericResponse"
"422":
description: Validation Error
content:
application/json:
schema:
$ref: "#/components/schemas/HTTPValidationError"
/events/{event_id}/description:
post:
tags:
@@ -4959,6 +5021,18 @@ components:
required:
- subLabel
title: EventsSubLabelBody
EventsAttributesBody:
properties:
attributes:
type: object
title: Attributes
description: Object with model names as keys and attribute values
additionalProperties:
type: string
type: object
required:
- attributes
title: EventsAttributesBody
ExportModel:
properties:
id: