forked from Github/frigate
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83481afee1 | ||
|
|
b1a2b0cda2 | ||
|
|
0dfba6e8d9 | ||
|
|
e4afe50509 | ||
|
|
f4c3bb0617 | ||
|
|
08f573aaa5 |
2
Makefile
2
Makefile
@@ -3,7 +3,7 @@ default_target: amd64_frigate
|
|||||||
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
|
COMMIT_HASH := $(shell git log -1 --pretty=format:"%h"|tail -1)
|
||||||
|
|
||||||
version:
|
version:
|
||||||
echo "VERSION='0.10.0-$(COMMIT_HASH)'" > frigate/version.py
|
echo "VERSION='0.10.1-$(COMMIT_HASH)'" > frigate/version.py
|
||||||
|
|
||||||
web:
|
web:
|
||||||
docker build --tag frigate-web --file docker/Dockerfile.web web/
|
docker build --tag frigate-web --file docker/Dockerfile.web web/
|
||||||
|
|||||||
@@ -170,6 +170,9 @@ detect:
|
|||||||
# This can help with false positives for objects that should only be stationary for a limited amount of time.
|
# This can help with false positives for objects that should only be stationary for a limited amount of time.
|
||||||
# It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave
|
# It can also be used to disable stationary object tracking. For example, you may want to set a value for person, but leave
|
||||||
# car at the default.
|
# car at the default.
|
||||||
|
# WARNING: Setting these values overrides default behavior and disables stationary object tracking.
|
||||||
|
# There are very few situations where you would want it disabled. It is NOT recommended to
|
||||||
|
# copy these values from the example config into your config unless you know they are needed.
|
||||||
max_frames:
|
max_frames:
|
||||||
# Optional: Default for all object types (default: not set, track forever)
|
# Optional: Default for all object types (default: not set, track forever)
|
||||||
default: 3000
|
default: 3000
|
||||||
@@ -233,6 +236,10 @@ motion:
|
|||||||
# Optional: motion mask
|
# Optional: motion mask
|
||||||
# NOTE: see docs for more detailed info on creating masks
|
# NOTE: see docs for more detailed info on creating masks
|
||||||
mask: 0,900,1080,900,1080,1920,0,1920
|
mask: 0,900,1080,900,1080,1920,0,1920
|
||||||
|
# Optional: improve contrast (default: shown below)
|
||||||
|
# Enables dynamic contrast improvement. This should help improve night detections at the cost of making motion detection more sensitive
|
||||||
|
# for daytime.
|
||||||
|
improve_contrast: False
|
||||||
|
|
||||||
# Optional: Record configuration
|
# Optional: Record configuration
|
||||||
# NOTE: Can be overridden at the camera level
|
# NOTE: Can be overridden at the camera level
|
||||||
|
|||||||
@@ -21,4 +21,18 @@ record:
|
|||||||
|
|
||||||
This configuration will retain recording segments that overlap with events and have active tracked objects for 10 days. Because multiple events can reference the same recording segments, this avoids storing duplicate footage for overlapping events and reduces overall storage needs.
|
This configuration will retain recording segments that overlap with events and have active tracked objects for 10 days. Because multiple events can reference the same recording segments, this avoids storing duplicate footage for overlapping events and reduces overall storage needs.
|
||||||
|
|
||||||
When `retain_days` is set to `0`, segments will be deleted from the cache if no events are in progress.
|
When `retain -> days` is set to `0`, segments will be deleted from the cache if no events are in progress.
|
||||||
|
|
||||||
|
## What do the different retain modes mean?
|
||||||
|
|
||||||
|
Frigate saves from the stream with the `record` role in 10 second segments. These options determine which recording segments are kept for 24/7 recording (but can also affect events).
|
||||||
|
|
||||||
|
Let's say you have frigate configured so that your doorbell camera would retain the last **2** days of 24/7 recording.
|
||||||
|
- With the `all` option all 48 hours of those two days would be kept and viewable.
|
||||||
|
- With the `motion` option the only parts of those 48 hours would be segments that frigate detected motion. This is the middle ground option that won't keep all 48 hours, but will likely keep all segments of interest along with the potential for some extra segments.
|
||||||
|
- With the `active_objects` option the only segments that would be kept are those where there was a true positive object that was not considered stationary.
|
||||||
|
|
||||||
|
The same options are available with events. Let's consider a scenario where you drive up and park in your driveway, go inside, then come back out 4 hours later.
|
||||||
|
- With the `all` option all segments for the duration of the event would be saved for the event. This event would have 4 hours of footage.
|
||||||
|
- With the `motion` option all segments for the duration of the event with motion would be saved. This means any segment where a car drove by in the street, person walked by, lighting changed, etc. would be saved.
|
||||||
|
- With the `active_objects` it would only keep segments where the object was active. In this case the only segments that would be saved would be the ones where the car was driving up, you going inside, you coming outside, and the car driving away. Essentially reducing the 4 hours to a minute or two of event footage.
|
||||||
|
|||||||
@@ -21,19 +21,17 @@ I may earn a small commission for my endorsement, recommendation, testimonial, o
|
|||||||
|
|
||||||
## Server
|
## Server
|
||||||
|
|
||||||
My current favorite is the Odyssey X86 Blue J4125 because the Coral M.2 compatibility and dual NICs that allow you to setup a dedicated private network for your cameras where they can be blocked from accessing the internet. I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website.
|
My current favorite is the Minisforum GK41 because of the dual NICs that allow you to setup a dedicated private network for your cameras where they can be blocked from accessing the internet. There are many used workstation options on eBay that work very well. Anything with an Intel CPU and capable of running Debian should work fine. As a bonus, you may want to look for devices with a M.2 or PCIe express slot that is compatible with the Google Coral. I may earn a small commission for my endorsement, recommendation, testimonial, or link to any products or services from this website.
|
||||||
|
|
||||||
| Name | Inference Speed | Coral Compatibility | Notes |
|
| Name | Inference Speed | Coral Compatibility | Notes |
|
||||||
| -------------------------------------------------------------------------------------------------------------------------------- | --------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------------------------------------------------------------------------------------------------------------------- | --------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| <a href="https://amzn.to/3oH4BKi" target="_blank" rel="nofollow noopener sponsored">Odyssey X86 Blue J4125</a> (affiliate link) | 9-10ms | M.2 B+M | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
|
| <a href="https://amzn.to/3oH4BKi" target="_blank" rel="nofollow noopener sponsored">Odyssey X86 Blue J4125</a> (affiliate link) | 9-10ms | M.2 B+M | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
|
||||||
| <a href="https://amzn.to/3oxEC8m" target="_blank" rel="nofollow noopener sponsored">Minisforum GK41</a> (affiliate link) | 9-10ms | USB | Great alternative to a NUC. Easily handles several 1080p cameras. |
|
| <a href="https://amzn.to/3ptnb8D" target="_blank" rel="nofollow noopener sponsored">Minisforum GK41</a> (affiliate link) | 9-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
|
||||||
| <a href="https://amzn.to/3ixJFlb" target="_blank" rel="nofollow noopener sponsored">Minisforum GK50</a> (affiliate link) | 9-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
|
| <a href="https://amzn.to/35E79BC" target="_blank" rel="nofollow noopener sponsored">Beelink GK55</a> (affiliate link) | 9-10ms | USB | Dual gigabit NICs for easy isolated camera network. Easily handles several 1080p cameras. |
|
||||||
| <a href="https://amzn.to/3l7vCEI" target="_blank" rel="nofollow noopener sponsored">Intel NUC</a> (affiliate link) | 8-10ms | USB | Overkill for most, but great performance. Can handle many cameras at 5fps depending on typical amounts of motion. |
|
| <a href="https://amzn.to/3psFlHi" target="_blank" rel="nofollow noopener sponsored">Intel NUC</a> (affiliate link) | 8-10ms | USB | Overkill for most, but great performance. Can handle many cameras at 5fps depending on typical amounts of motion. Requires extra parts. |
|
||||||
| <a href="https://amzn.to/3a6TBh8" target="_blank" rel="nofollow noopener sponsored">BMAX B2 Plus</a> (affiliate link) | 10-12ms | USB | Good balance of performance and cost. Also capable of running many other services at the same time as frigate. |
|
| <a href="https://amzn.to/3a6TBh8" target="_blank" rel="nofollow noopener sponsored">BMAX B2 Plus</a> (affiliate link) | 10-12ms | USB | Good balance of performance and cost. Also capable of running many other services at the same time as frigate. |
|
||||||
| <a href="https://amzn.to/2YjpY9m" target="_blank" rel="nofollow noopener sponsored">Atomic Pi</a> (affiliate link) | 16ms | USB | Good option for a dedicated low power board with a small number of cameras. Can leverage Intel QuickSync for stream decoding. |
|
| <a href="https://amzn.to/2YjpY9m" target="_blank" rel="nofollow noopener sponsored">Atomic Pi</a> (affiliate link) | 16ms | USB | Good option for a dedicated low power board with a small number of cameras. Can leverage Intel QuickSync for stream decoding. |
|
||||||
| <a href="https://amzn.to/2WIpwRU" target="_blank" rel="nofollow noopener sponsored">Raspberry Pi 3B (32bit)</a> (affiliate link) | 60ms | USB | Can handle a small number of cameras, but the detection speeds are slow due to USB 2.0. |
|
| <a href="https://amzn.to/2YhSGHH" target="_blank" rel="nofollow noopener sponsored">Raspberry Pi 4 (64bit)</a> (affiliate link) | 10-15ms | USB | Can handle a small number of cameras. |
|
||||||
| <a href="https://amzn.to/2YhSGHH" target="_blank" rel="nofollow noopener sponsored">Raspberry Pi 4 (32bit)</a> (affiliate link) | 15-20ms | USB | Can handle a small number of cameras. The 2GB version runs fine. |
|
|
||||||
| <a href="https://amzn.to/2YhSGHH" target="_blank" rel="nofollow noopener sponsored">Raspberry Pi 4 (64bit)</a> (affiliate link) | 10-15ms | USB | Can handle a small number of cameras. The 2GB version runs fine. |
|
|
||||||
|
|
||||||
## Google Coral TPU
|
## Google Coral TPU
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ class MotionConfig(FrigateBaseModel):
|
|||||||
ge=1,
|
ge=1,
|
||||||
le=255,
|
le=255,
|
||||||
)
|
)
|
||||||
|
improve_contrast: bool = Field(default=False, title="Improve Contrast")
|
||||||
contour_area: Optional[int] = Field(default=30, title="Contour Area")
|
contour_area: Optional[int] = Field(default=30, title="Contour Area")
|
||||||
delta_alpha: float = Field(default=0.2, title="Delta Alpha")
|
delta_alpha: float = Field(default=0.2, title="Delta Alpha")
|
||||||
frame_alpha: float = Field(default=0.2, title="Frame Alpha")
|
frame_alpha: float = Field(default=0.2, title="Frame Alpha")
|
||||||
|
|||||||
@@ -38,14 +38,15 @@ class MotionDetector:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Improve contrast
|
# Improve contrast
|
||||||
minval = np.percentile(resized_frame, 4)
|
if self.config.improve_contrast:
|
||||||
maxval = np.percentile(resized_frame, 96)
|
minval = np.percentile(resized_frame, 4)
|
||||||
# don't adjust if the image is a single color
|
maxval = np.percentile(resized_frame, 96)
|
||||||
if minval < maxval:
|
# don't adjust if the image is a single color
|
||||||
resized_frame = np.clip(resized_frame, minval, maxval)
|
if minval < maxval:
|
||||||
resized_frame = (
|
resized_frame = np.clip(resized_frame, minval, maxval)
|
||||||
((resized_frame - minval) / (maxval - minval)) * 255
|
resized_frame = (
|
||||||
).astype(np.uint8)
|
((resized_frame - minval) / (maxval - minval)) * 255
|
||||||
|
).astype(np.uint8)
|
||||||
|
|
||||||
# mask frame
|
# mask frame
|
||||||
resized_frame[self.mask] = [255]
|
resized_frame[self.mask] = [255]
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ class ObjectTracker:
|
|||||||
obj["motionless_count"] - self.detect_config.stationary.threshold
|
obj["motionless_count"] - self.detect_config.stationary.threshold
|
||||||
> max_frames
|
> max_frames
|
||||||
):
|
):
|
||||||
print(f"expired: {obj['motionless_count']}")
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def update(self, id, new_obj):
|
def update(self, id, new_obj):
|
||||||
|
|||||||
Reference in New Issue
Block a user