Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2eec164
Initial plan
Copilot Jan 31, 2026
0892a0f
Add zone field to custom_classification MQTT events
Copilot Jan 31, 2026
e3b3b36
Refactor tests to extract duplicate logic into helper method
Copilot Jan 31, 2026
076ced6
Add integration tests for obj_data current_zones structure
Copilot Jan 31, 2026
1b51f11
Replace useless tests with actual implementation verification tests
Copilot Jan 31, 2026
f7dd911
Add TRUE integration tests that call process_frame method
Copilot Jan 31, 2026
6e176b0
Apply mocks only when setting up the integration test
Teagan42 Jan 31, 2026
b7b60ad
Correct formatting
Teagan42 Jan 31, 2026
7736bbc
Store original mocks at on import
Teagan42 Jan 31, 2026
d837ca3
Fix formatting
Teagan42 Jan 31, 2026
6c8b4be
Type-o
Teagan42 Jan 31, 2026
04de83f
Fix type-o
Teagan42 Jan 31, 2026
0ba0883
Mock modules but restore only modules that exist
Teagan42 Jan 31, 2026
2eb18d1
Fix formatting
Teagan42 Jan 31, 2026
17f506f
Keep util and const unmocked
Teagan42 Jan 31, 2026
6a39b44
Caching dev container
Teagan42 Jan 31, 2026
b9b37a5
Leave numpy and cv2 unmocked
Teagan42 Jan 31, 2026
a54af21
Job needs devcontainer job
Teagan42 Jan 31, 2026
8d1c655
Fix runs-on key in workflow
Teagan42 Jan 31, 2026
f5cb737
Fix image tagging
Teagan42 Jan 31, 2026
5dc9cf2
Mock cvtColor and resize from cv2 module
Teagan42 Jan 31, 2026
666e05f
Fix formatting and patching
Teagan42 Jan 31, 2026
b80bd0b
Fix mock module name
Teagan42 Jan 31, 2026
cc5cfdb
Mock suppress_stderr_during
Teagan42 Jan 31, 2026
3c4112c
Change to mock classes
Teagan42 Jan 31, 2026
08c58ea
Temporarily log argument
Teagan42 Jan 31, 2026
f0bde38
Log
Teagan42 Jan 31, 2026
75ef4e8
Remove log
Teagan42 Jan 31, 2026
86a12b1
Merge pull request #1 from constructorfleet/copilot/add-zone-to-custo…
Teagan42 Jan 31, 2026
6f55cdf
Bump protobuf from 3.20.3 to 5.29.6 in /docker/tensorrt
dependabot[bot] Feb 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

env:
DEFAULT_PYTHON: 3.11
REGISTRY: ghcr.io
DEV_IMAGE_NAME: ${{ github.repository }}-dev

jobs:
web_lint:
Expand Down Expand Up @@ -78,18 +80,18 @@ jobs:
uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
node-version: 20.x
- name: Install devcontainer cli
run: npm install --global @devcontainers/cli
- name: Build devcontainer
env:
DOCKER_BUILDKIT: "1"
run: devcontainer build --workspace-folder .
- name: Start devcontainer
run: devcontainer up --workspace-folder .
- name: Run mypy in devcontainer
run: devcontainer exec --workspace-folder . bash -lc "python3 -u -m mypy --config-file frigate/mypy.ini frigate"
- name: Run unit tests in devcontainer
run: devcontainer exec --workspace-folder . bash -lc "python3 -u -m unittest"
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build devcontainer image and run checks
uses: devcontainers/ci@v0.3
with:
imageName: ${{ env.REGISTRY }}/${{ env.DEV_IMAGE_NAME }}
cacheFrom: ${{ env.REGISTRY }}/${{ env.DEV_IMAGE_NAME }}
push: always
runCmd: |-
python3 -u -m mypy --config-file frigate/mypy.ini frigate &&
python3 -u -m unittest
2 changes: 1 addition & 1 deletion docker/tensorrt/requirements-amd64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ nvidia_nccl_cu12==2.23.4; platform_machine == 'x86_64'
nvidia_nvjitlink_cu12==12.5.82; platform_machine == 'x86_64'
onnx==1.16.*; platform_machine == 'x86_64'
onnxruntime-gpu==1.22.*; platform_machine == 'x86_64'
protobuf==3.20.3; platform_machine == 'x86_64'
protobuf==5.29.6; platform_machine == 'x86_64'
2 changes: 1 addition & 1 deletion docker/tensorrt/requirements-models-arm64.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
onnx == 1.14.0; platform_machine == 'aarch64'
protobuf == 3.20.3; platform_machine == 'aarch64'
protobuf == 5.29.6; platform_machine == 'aarch64'
10 changes: 8 additions & 2 deletions docs/docs/integrations/mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ Message published when [object classification](/configuration/custom_classificat
"timestamp": 1607123958.748393,
"model": "person_classifier",
"sub_label": "delivery_person",
"score": 0.87
"score": 0.87,
"zones": ["front_yard", "driveway"]
}
```

Expand All @@ -187,10 +188,15 @@ Message published when [object classification](/configuration/custom_classificat
"timestamp": 1607123958.748393,
"model": "helmet_detector",
"attribute": "yes",
"score": 0.92
"score": 0.92,
"zones": ["front_yard"]
}
```

:::note
The `zones` field is only included if the tracked object is currently in one or more zones.
:::

### `frigate/reviews`

Message published for each changed review item. The first message is published when the `detection` or `alert` is initiated.
Expand Down
46 changes: 24 additions & 22 deletions frigate/data_processing/real_time/custom_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,19 +613,20 @@ def process_frame(self, obj_data, frame):
(object_id, consensus_label, consensus_score),
EventMetadataTypeEnum.sub_label,
)
classification_data = {
"type": TrackedObjectUpdateTypesEnum.classification,
"id": object_id,
"camera": camera,
"timestamp": now,
"model": self.model_config.name,
"sub_label": consensus_label,
"score": consensus_score,
}
if obj_data.get("current_zones"):
classification_data["zones"] = obj_data["current_zones"]
self.requestor.send_data(
"tracked_object_update",
json.dumps(
{
"type": TrackedObjectUpdateTypesEnum.classification,
"id": object_id,
"camera": camera,
"timestamp": now,
"model": self.model_config.name,
"sub_label": consensus_label,
"score": consensus_score,
}
),
json.dumps(classification_data),
)
elif (
self.model_config.object_config.classification_type
Expand All @@ -640,19 +641,20 @@ def process_frame(self, obj_data, frame):
),
EventMetadataTypeEnum.attribute.value,
)
classification_data = {
"type": TrackedObjectUpdateTypesEnum.classification,
"id": object_id,
"camera": camera,
"timestamp": now,
"model": self.model_config.name,
"attribute": consensus_label,
"score": consensus_score,
}
if obj_data.get("current_zones"):
classification_data["zones"] = obj_data["current_zones"]
self.requestor.send_data(
"tracked_object_update",
json.dumps(
{
"type": TrackedObjectUpdateTypesEnum.classification,
"id": object_id,
"camera": camera,
"timestamp": now,
"model": self.model_config.name,
"attribute": consensus_label,
"score": consensus_score,
}
),
json.dumps(classification_data),
)

def handle_request(self, topic, request_data):
Expand Down
Loading
Loading