Feature Request: Configurable high-resolution and tiled inference for AI Port object detection
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 32/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- machine-learning, python
- Domain
- ai, computer-vision, performance
Research direction
Start by reviewing the existing AI Port detection and inference path, then examine the higher-resolution frame pipeline from PR #144 for a starting point. Identify where YOLOX inputs, tiled-region coordinates, deduplication, and tracker handoff would need to be integrated; run the existing detection and tracking tests. Done means configurable profiles work while Standard remains the default, tiled detections map back to original frames, and compatibility tests cover tracking, zones, and Protect events.
Written by the indexing model from the issue text.
Description
Background
Keystone's current AI Port object detection implementation uses fixed 640×640 YOLOX model inputs (416×416 for YOLOX-Tiny). While this provides excellent computational efficiency, it potentially sacrifices significant detection accuracy when processing high-resolution cameras, particularly for small or distant objects.
This limitation is especially pronounced with ultrawide and multisensor panoramic cameras. For example, a 4096×1536 panoramic stream becomes an effective 640×240 image within the detector's input tensor.
Increasing aiport.analyze_max_width does not resolve this limitation because the detector subsequently resizes the image to the model's fixed input dimensions.
Proposed Enhancement
Introduce configurable object detection quality profiles, ideally on a per-camera basis:
- Standard: Retain the current full-frame inference implementation as the default.
- High Resolution: Support larger model input dimensions where compatible ONNX models are available.
- Tiled Inference: Divide higher-resolution frames into overlapping regions, perform inference on each region, translate bounding boxes back into the original image coordinates, and deduplicate overlapping detections before passing them to the tracker.
Tiled inference could potentially follow an approach similar to SAHI (Slicing Aided Hyper Inference), while retaining Keystone's existing Apache-licensed models and inference infrastructure.
Optional motion-directed regional inference could further reduce computational requirements.
Potential Implementation Opportunities
Several recent PRs appear to provide useful groundwork:
- #144 — Synchronized higher-resolution frames for smart detection snapshots.
- #127 — Camera-native ONVIF motion events to gate inference.
- #148 — Improved object tracking and event continuity.
- #80 and #93 — GPU-accelerated inference capabilities.
The higher-resolution frame pipeline introduced in #144 may provide a useful starting point for regional inference without requiring a separate video decoding pipeline.
The published YOLOX-M performance benchmarks in #80 also suggest that multiple inference passes per frame could be computationally practical, even on modern integrated GPUs.
Real-World Use Case
I am implementing a UniFi Protect deployment at a church with approximately 50–60 cameras, an Enterprise NVR, three physical AI Keys, and six physical AI Ports.
Two existing Hikvision dual-sensor 180-degree panoramic cameras are particularly interesting candidates for Keystone because Ubiquiti's physical AI Ports do not support these wide-aspect-ratio multisensor cameras.
Beyond panoramic camera compatibility, improved detection resolution would benefit conventional 4K cameras monitoring large outdoor spaces, parking lots, and other areas where distant object detection is important.
Desired Outcome
Allow users to trade additional computational resources for improved detection accuracy, without sacrificing compatibility with Protect's native detection events, zones, tracking, and recording functionality.
The existing low-compute implementation should remain available and continue to be the default.
I would be interested in helping test this functionality in a real-world deployment.
Is this something that would fit within Keystone's architectural direction?
- Dominant language
- Python
- Stars
- 1k
- Forks
- 114
- Avg merge
- 1h
- Merged PRs (30d)
- 115
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from seeARMS/keystone
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
All issues in seeARMS/keystone
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day