mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-27 02:28:22 +03:00
Compare commits
3 Commits
b871d7beb7
...
d6e0a9da8c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6e0a9da8c | ||
|
|
ef5608a970 | ||
|
|
8c69927438 |
@ -8,3 +8,56 @@ For installation and contributing instructions, please follow the [Contributing
|
||||
|
||||
1. Run `npm i` to install dependencies
|
||||
2. Run `npm run start` to start the website
|
||||
|
||||
# Documentation Style Guide
|
||||
|
||||
## Internal Links
|
||||
|
||||
When adding or editing internal links, follow these conventions:
|
||||
|
||||
### Do not include the `.md` extension
|
||||
|
||||
Use paths without extensions. This avoids needing `index.md` for directory index pages and matches the web URL.
|
||||
|
||||
```markdown
|
||||
<!-- Good -->
|
||||
[zones](/configuration/zones)
|
||||
[getting started](../guides/getting_started)
|
||||
|
||||
<!-- Bad -->
|
||||
[zones](/configuration/zones.md)
|
||||
```
|
||||
|
||||
### Use relative paths for same-directory links
|
||||
|
||||
Use relative `./` paths for links to pages in the same directory.
|
||||
|
||||
```markdown
|
||||
[zones](./zones)
|
||||
[masks](./masks)
|
||||
```
|
||||
|
||||
### Use absolute paths for everything else
|
||||
|
||||
For links outside the current directory, use absolute paths from the docs root. The exception is deeply nested subdirectories (e.g., `configuration/custom_classification/`) where `../` to the parent directory is acceptable.
|
||||
|
||||
```markdown
|
||||
[object detectors](/configuration/object_detectors)
|
||||
[hardware](/frigate/hardware)
|
||||
[getting started](/guides/getting_started)
|
||||
|
||||
<!-- Also OK from a nested subdirectory -->
|
||||
[zones](../zones)
|
||||
```
|
||||
|
||||
### Never use full URLs for internal links
|
||||
|
||||
```markdown
|
||||
<!-- Good -->
|
||||
[zones](/configuration/zones)
|
||||
|
||||
<!-- Bad -->
|
||||
[zones](https://docs.frigate.video/configuration/zones)
|
||||
```
|
||||
|
||||
> **Note:** Some existing links still use `.md` extensions. These should be updated when the file is being edited for other reasons.
|
||||
|
||||
@ -33,7 +33,6 @@ from frigate.config.camera.updater import (
|
||||
CameraConfigUpdateEnum,
|
||||
CameraConfigUpdateSubscriber,
|
||||
)
|
||||
from frigate.config.classification import ObjectClassificationType
|
||||
from frigate.const import (
|
||||
FAST_QUEUE_TIMEOUT,
|
||||
UPDATE_CAMERA_ACTIVITY,
|
||||
@ -760,16 +759,8 @@ class TrackedObjectProcessor(threading.Thread):
|
||||
|
||||
self.update_mqtt_motion(camera, frame_time, motion_boxes)
|
||||
|
||||
attribute_model_names = [
|
||||
name
|
||||
for name, model_config in self.config.classification.custom.items()
|
||||
if model_config.object_config
|
||||
and model_config.object_config.classification_type
|
||||
== ObjectClassificationType.attribute
|
||||
]
|
||||
tracked_objects = [
|
||||
o.to_dict(attribute_model_names=attribute_model_names)
|
||||
for o in camera_state.tracked_objects.values()
|
||||
o.to_dict() for o in camera_state.tracked_objects.values()
|
||||
]
|
||||
|
||||
# publish info on this frame
|
||||
|
||||
@ -376,11 +376,15 @@ class TrackedObject:
|
||||
)
|
||||
return (thumb_update, significant_change, path_update, autotracker_update)
|
||||
|
||||
def to_dict(
|
||||
self,
|
||||
attribute_model_names: list[str] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
event = {
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
# Tracking internals excluded from output (centroid, estimate, estimate_velocity)
|
||||
_EXCLUDED_OBJ_DATA_KEYS = {
|
||||
"centroid",
|
||||
"estimate",
|
||||
"estimate_velocity",
|
||||
}
|
||||
|
||||
event: dict[str, Any] = {
|
||||
"id": self.obj_data["id"],
|
||||
"camera": self.camera_config.name,
|
||||
"frame_time": self.obj_data["frame_time"],
|
||||
@ -414,11 +418,11 @@ class TrackedObject:
|
||||
"path_data": self.path_data.copy(),
|
||||
"recognized_license_plate": self.obj_data.get("recognized_license_plate"),
|
||||
}
|
||||
if attribute_model_names is not None:
|
||||
for name in attribute_model_names:
|
||||
value = self.obj_data.get(name)
|
||||
if value is not None:
|
||||
event[name] = value
|
||||
|
||||
# Add any other obj_data keys (e.g. custom attribute fields) not yet included
|
||||
for key, value in self.obj_data.items():
|
||||
if key not in _EXCLUDED_OBJ_DATA_KEYS and key not in event:
|
||||
event[key] = value
|
||||
|
||||
return event
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user