Skip to content

Commit 9b2d5ae

Browse files
authored
Merge branch 'blakeblackshear:dev' into testing
2 parents def2938 + 256817d commit 9b2d5ae

File tree

66 files changed

+2398
-1956
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2398
-1956
lines changed

docker/main/install_memryx.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
set -e
33

44
# Download the MxAccl for Frigate github release
5-
wget https://github.com/memryx/mx_accl_frigate/archive/refs/heads/main.zip -O /tmp/mxaccl.zip
5+
wget https://github.com/memryx/mx_accl_frigate/archive/refs/tags/v2.1.0.zip -O /tmp/mxaccl.zip
66
unzip /tmp/mxaccl.zip -d /tmp
7-
mv /tmp/mx_accl_frigate-main /opt/mx_accl_frigate
7+
mv /tmp/mx_accl_frigate-2.1.0 /opt/mx_accl_frigate
88
rm /tmp/mxaccl.zip
99

1010
# Install Python dependencies

docker/main/requirements-wheels.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pywebpush == 2.0.*
5656
# alpr
5757
pyclipper == 1.3.*
5858
shapely == 2.0.*
59-
Levenshtein==0.26.*
59+
rapidfuzz==3.12.*
6060
# HailoRT Wheels
6161
appdirs==1.4.*
6262
argcomplete==2.0.*

docker/memryx/user_installation.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ echo "Adding MemryX GPG key and repository..."
2424
wget -qO- https://developer.memryx.com/deb/memryx.asc | sudo tee /etc/apt/trusted.gpg.d/memryx.asc >/dev/null
2525
echo 'deb https://developer.memryx.com/deb stable main' | sudo tee /etc/apt/sources.list.d/memryx.list >/dev/null
2626

27-
# Update and install memx-drivers
28-
echo "Installing memx-drivers..."
27+
# Update and install specific SDK 2.1 packages
28+
echo "Installing MemryX SDK 2.1 packages..."
2929
sudo apt update
30-
sudo apt install -y memx-drivers
30+
sudo apt install -y memx-drivers=2.1.* memx-accl=2.1.* mxa-manager=2.1.*
31+
32+
# Hold packages to prevent automatic upgrades
33+
sudo apt-mark hold memx-drivers memx-accl mxa-manager
3134

3235
# ARM-specific board setup
3336
if [[ "$arch" == "aarch64" || "$arch" == "arm64" ]]; then
@@ -37,11 +40,5 @@ fi
3740

3841
echo -e "\n\n\033[1;31mYOU MUST RESTART YOUR COMPUTER NOW\033[0m\n\n"
3942

40-
# Install other runtime packages
41-
packages=("memx-accl" "mxa-manager")
42-
for pkg in "${packages[@]}"; do
43-
echo "Installing $pkg..."
44-
sudo apt install -y "$pkg"
45-
done
43+
echo "MemryX SDK 2.1 installation complete!"
4644

47-
echo "MemryX installation complete!"

docker/tensorrt/Dockerfile.amd64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ FROM deps AS frigate-tensorrt
2121
ARG PIP_BREAK_SYSTEM_PACKAGES
2222

2323
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
24-
pip3 uninstall -y onnxruntime tensorflow-cpu \
24+
pip3 uninstall -y onnxruntime \
2525
&& pip3 install -U /deps/trt-wheels/*.whl
2626

2727
COPY --from=rootfs / /

docker/tensorrt/requirements-amd64.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ nvidia_cusolver_cu12==11.6.3.*; platform_machine == 'x86_64'
1313
nvidia_cusparse_cu12==12.5.1.*; platform_machine == 'x86_64'
1414
nvidia_nccl_cu12==2.23.4; platform_machine == 'x86_64'
1515
nvidia_nvjitlink_cu12==12.5.82; platform_machine == 'x86_64'
16-
tensorflow==2.19.*; platform_machine == 'x86_64'
1716
onnx==1.16.*; platform_machine == 'x86_64'
1817
onnxruntime-gpu==1.22.*; platform_machine == 'x86_64'
1918
protobuf==3.20.3; platform_machine == 'x86_64'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
cuda-python == 12.6.*; platform_machine == 'aarch64'
2+
numpy == 1.26.*; platform_machine == 'aarch64'

docs/docs/configuration/custom_classification/object_classification.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Object classification allows you to train a custom MobileNetV2 classification mo
1010
Object classification models are lightweight and run very fast on CPU. Inference should be usable on virtually any machine that can run Frigate.
1111

1212
Training the model does briefly use a high amount of system resources for about 1–3 minutes per training run. On lower-power devices, training may take longer.
13-
When running the `-tensorrt` image, Nvidia GPUs will automatically be used to accelerate training.
1413

1514
## Classes
1615

docs/docs/configuration/custom_classification/state_classification.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ State classification allows you to train a custom MobileNetV2 classification mod
1010
State classification models are lightweight and run very fast on CPU. Inference should be usable on virtually any machine that can run Frigate.
1111

1212
Training the model does briefly use a high amount of system resources for about 1–3 minutes per training run. On lower-power devices, training may take longer.
13-
When running the `-tensorrt` image, Nvidia GPUs will automatically be used to accelerate training.
1413

1514
## Classes
1615

docs/docs/configuration/genai/config.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ The following models are recommended:
4343

4444
| Model | Notes |
4545
| ----------------- | ----------------------------------------------------------- |
46-
| `Intern3.5VL` | Relatively fast with good vision comprehension
46+
| `qwen3-vl` | Strong visual and situational understanding |
47+
| `Intern3.5VL` | Relatively fast with good vision comprehension |
4748
| `gemma3` | Strong frame-to-frame understanding, slower inference times |
48-
| `qwen2.5vl` | Fast but capable model with good vision comprehension |
49+
| `qwen2.5-vl` | Fast but capable model with good vision comprehension |
4950
| `llava-phi3` | Lightweight and fast model with vision comprehension |
5051

5152
:::note

docs/docs/configuration/genai/review_summaries.md

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,67 @@ Generative AI can be used to automatically generate structured summaries of revi
77

88
Requests for a summary are requested automatically to your AI provider for alert review items when the activity has ended, they can also be optionally enabled for detections as well.
99

10-
Generative AI review summaries can also be toggled dynamically for a camera via MQTT with the topic `frigate/<camera_name>/review_descriptions/set`. See the [MQTT documentation](/integrations/mqtt/#frigatecamera_namereviewdescriptionsset).
10+
Generative AI review summaries can also be toggled dynamically for a [camera via MQTT](/integrations/mqtt/#frigatecamera_namereviewdescriptionsset).
1111

1212
## Review Summary Usage and Best Practices
1313

1414
Review summaries provide structured JSON responses that are saved for each review item:
1515

1616
```
17-
- `scene` (string): A full description including setting, entities, actions, and any plausible supported inferences.
18-
- `confidence` (float): 0-1 confidence in the analysis.
17+
- `title` (string): A concise, direct title that describes the purpose or overall action (e.g., "Person taking out trash", "Joe walking dog").
18+
- `scene` (string): A narrative description of what happens across the sequence from start to finish, including setting, detected objects, and their observable actions.
19+
- `confidence` (float): 0-1 confidence in the analysis. Higher confidence when objects/actions are clearly visible and context is unambiguous.
1920
- `other_concerns` (list): List of user-defined concerns that may need additional investigation.
2021
- `potential_threat_level` (integer): 0, 1, or 2 as defined below.
21-
22-
Threat-level definitions:
23-
- 0 — Typical or expected activity for this location/time (includes residents, guests, or known animals engaged in normal activities, even if they glance around or scan surroundings).
24-
- 1 — Unusual or suspicious activity: At least one security-relevant behavior is present **and not explainable by a normal residential activity**.
25-
- 2 — Active or immediate threat: Breaking in, vandalism, aggression, weapon display.
2622
```
2723

28-
This will show in the UI as a list of concerns that each review item has along with the general description.
24+
This will show in multiple places in the UI to give additional context about each activity, and allow viewing more details when extra attention is required. Frigate's built in notifications will also automatically show the title and description when the data is available.
2925

3026
### Defining Typical Activity
3127

32-
Each installation and even camera can have different parameters for what is considered suspicious activity. Frigate allows the `activity_context_prompt` to be defined globally and at the camera level, which allows you to define more specifically what should be considered normal activity. It is important that this is not overly specific as it can sway the output of the response. The default `activity_context_prompt` is below:
28+
Each installation and even camera can have different parameters for what is considered suspicious activity. Frigate allows the `activity_context_prompt` to be defined globally and at the camera level, which allows you to define more specifically what should be considered normal activity. It is important that this is not overly specific as it can sway the output of the response.
29+
30+
<details>
31+
<summary>Default Activity Context Prompt</summary>
3332

3433
```
35-
- **Zone context is critical**: Private enclosed spaces (back yards, back decks, fenced areas, inside garages) are resident territory where brief transient activity, routine tasks, and pet care are expected and normal. Front yards, driveways, and porches are semi-public but still resident spaces where deliveries, parking, and coming/going are routine. Consider whether the zone and activity align with normal residential use.
36-
- **Person + Pet = Normal Activity**: When both "Person" and "Dog" (or "Cat") are detected together in residential zones, this is routine pet care activity (walking, letting out, playing, supervising). Assign Level 0 unless there are OTHER strong suspicious behaviors present (like testing doors, taking items, etc.). A person with their pet in a residential zone is baseline normal activity.
37-
- Brief appearances in private zones (back yards, garages) are normal residential patterns.
38-
- Normal residential activity includes: residents, family members, guests, deliveries, services, maintenance workers, routine property use (parking, unloading, mail pickup, trash removal).
39-
- Brief movement with legitimate items (bags, packages, tools, equipment) in appropriate zones is routine.
34+
### Normal Activity Indicators (Level 0)
35+
- Known/verified people in any zone at any time
36+
- People with pets in residential areas
37+
- Deliveries or services during daytime/evening (6 AM - 10 PM): carrying packages to doors/porches, placing items, leaving
38+
- Services/maintenance workers with visible tools, uniforms, or service vehicles during daytime
39+
- Activity confined to public areas only (sidewalks, streets) without entering property at any time
40+
41+
### Suspicious Activity Indicators (Level 1)
42+
- **Testing or attempting to open doors/windows/handles on vehicles or buildings** — ALWAYS Level 1 regardless of time or duration
43+
- **Unidentified person in private areas (driveways, near vehicles/buildings) during late night/early morning (11 PM - 5 AM)** — ALWAYS Level 1 regardless of activity or duration
44+
- Taking items that don't belong to them (packages, objects from porches/driveways)
45+
- Climbing or jumping fences/barriers to access property
46+
- Attempting to conceal actions or items from view
47+
- Prolonged loitering: remaining in same area without visible purpose throughout most of the sequence
48+
49+
### Critical Threat Indicators (Level 2)
50+
- Holding break-in tools (crowbars, pry bars, bolt cutters)
51+
- Weapons visible (guns, knives, bats used aggressively)
52+
- Forced entry in progress
53+
- Physical aggression or violence
54+
- Active property damage or theft in progress
55+
56+
### Assessment Guidance
57+
Evaluate in this order:
58+
59+
1. **If person is verified/known** → Level 0 regardless of time or activity
60+
2. **If person is unidentified:**
61+
- Check time: If late night/early morning (11 PM - 5 AM) AND in private areas (driveways, near vehicles/buildings) → Level 1
62+
- Check actions: If testing doors/handles, taking items, climbing → Level 1
63+
- Otherwise, if daytime/evening (6 AM - 10 PM) with clear legitimate purpose (delivery, service worker) → Level 0
64+
3. **Escalate to Level 2 if:** Weapons, break-in tools, forced entry in progress, violence, or active property damage visible (escalates from Level 0 or 1)
65+
66+
The mere presence of an unidentified person in private areas during late night hours is inherently suspicious and warrants human review, regardless of what activity they appear to be doing or how brief the sequence is.
4067
```
4168

69+
</details>
70+
4271
### Image Source
4372

4473
By default, review summaries use preview images (cached preview frames) which have a lower resolution but use fewer tokens per image. For better image quality and more detailed analysis, you can configure Frigate to extract frames directly from recordings at a higher resolution:
@@ -50,11 +79,19 @@ review:
5079
image_source: recordings # Options: "preview" (default) or "recordings"
5180
```
5281
53-
When using `recordings`, frames are extracted at 480p resolution (480px height), providing better detail for the LLM while being mindful of context window size. This is particularly useful for scenarios where fine details matter, such as identifying license plates, reading text, or analyzing distant objects. Note that using recordings will:
82+
When using `recordings`, frames are extracted at 480px height while maintaining the camera's original aspect ratio, providing better detail for the LLM while being mindful of context window size. This is particularly useful for scenarios where fine details matter, such as identifying license plates, reading text, or analyzing distant objects.
83+
84+
The number of frames sent to the LLM is dynamically calculated based on:
85+
86+
- Your LLM provider's context window size
87+
- The camera's resolution and aspect ratio (ultrawide cameras like 32:9 use more tokens per image)
88+
- The image source (recordings use more tokens than preview images)
89+
90+
Frame counts are automatically optimized to use ~98% of the available context window while capping at 20 frames maximum to ensure reasonable inference times. Note that using recordings will:
5491

5592
- Provide higher quality images to the LLM (480p vs 180p preview images)
56-
- Use more tokens per image (~200-300 tokens vs ~100 tokens for preview)
57-
- Result in fewer frames being sent to stay within context limits (typically 6-12 frames vs 8-20 frames)
93+
- Use more tokens per image due to higher resolution
94+
- Result in fewer frames being sent for ultrawide cameras due to larger image size
5895
- Require that recordings are enabled for the camera
5996

6097
If recordings are not available for a given time period, the system will automatically fall back to using preview frames.
@@ -73,4 +110,4 @@ review:
73110

74111
## Review Reports
75112

76-
Along with individual review item summaries, Generative AI provides the ability to request a report of a given time period. For example, you can get a daily report while on a vacation of any suspicious activity or other concerns that may require review.
113+
Along with individual review item summaries, Generative AI provides the ability to request a report of a given time period. For example, you can get a daily report while on a vacation of any suspicious activity or other concerns that may require review.

0 commit comments

Comments
 (0)