remove custom detector doc

This commit is contained in:
Dennis George 2022-12-10 17:32:31 -06:00
parent 214825f289
commit 1da28eaa45

View File

@ -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>
```