mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
remove custom detector doc
This commit is contained in:
parent
214825f289
commit
1da28eaa45
@ -147,38 +147,3 @@ device_cgroup_rules:
|
||||
volumes:
|
||||
- /dev/bus/usb:/dev/bus/usb
|
||||
```
|
||||
|
||||
## Custom Detectors
|
||||
|
||||
Custom python detector modules can be added at `/opt/frigate/frigate/detectors/plugins` in the container.
|
||||
See the below for an example implementation.
|
||||
|
||||
```python
|
||||
from frigate.detectors.detection_api import DetectionApi
|
||||
from frigate.detectors.detector_config import BaseDetectorConfig
|
||||
from typing import Literal
|
||||
from pydantic import Extra, Field
|
||||
|
||||
DETECTOR_KEY = "<detector_key>"
|
||||
|
||||
# A pydantic model inheriting from `BaseDetectorConfig`
|
||||
# Must implement the `type` attribute as below
|
||||
# Can add any number of fields to be passed from
|
||||
# configuration to the constructor of your detector.
|
||||
class CustomDetectorConfig(BaseDetectorConfig):
|
||||
type: Literal[DETECTOR_KEY]
|
||||
custom_field: str = Field(default="value", title="Custom field description")
|
||||
|
||||
|
||||
# The custom detector class must inherit from `DetectionApi`
|
||||
# and must implement the `type_key`, `__init__`,
|
||||
# and `detect_raw` methods as below
|
||||
class CustomDetector(DetectionApi):
|
||||
type_key = DETECTOR_KEY
|
||||
|
||||
def __init__(self, detector_config: CustomDetectorConfig):
|
||||
...
|
||||
|
||||
def detect_raw(self, tensor_input):
|
||||
return <list of detections>
|
||||
```
|
||||
Loading…
Reference in New Issue
Block a user