Add sync subnode for FrameCropper inputs#303
Conversation
📝 WalkthroughWalkthroughFrameCropper's Script-based cropping pipeline is refactored to synchronize frame and detection/config inputs using dai.node.Sync with a configurable syncThreshold. Script content consumes synchronized groups instead of separate ports, WAIT_FOR_CFG gating is removed, and node construction now uses createSubnode. ChangesFrameCropper synchronized cropping pipeline
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ImageManip
participant Sync
participant Script
ImageManip->>Sync: inputImage
ImageManip->>Sync: detections/configs
Sync->>Script: synced group (frame + detections/configs) within syncThreshold
Script->>Script: crop/process using synced data
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@depthai_nodes/node/frame_cropper.py`:
- Around line 201-209: The docstring for the FrameCropper configuration method
should explicitly note the timestamp requirement when waitForConfig=True. Update
the text near inputManipConfigs/syncThreshold to say that the MessageGroup must
carry a timestamp aligned with inputImage because dai.node.Sync uses it to pair
config groups with frames; mention that untimestamped groups will not
synchronize. Keep the existing explanation of reuse behavior when
waitForConfig=False, and reference the FrameCropper method and waitForConfig
branch so the change is easy to locate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 24191cb7-9ea0-4afe-af23-53f85db3faec
📒 Files selected for processing (1)
depthai_nodes/node/frame_cropper.py
Purpose
Add Sync subnode in front of
FrameCropperinputs. This enables non-blocking queue usage earlier in the pipeline and makes theFrameCroppernode more robust.Specification
None / not applicable
Dependencies & Potential Impact
None / not applicable
Deployment Plan
None / not applicable
Testing & Validation
All oak-examples using
FrameCropperwork same as before after this change.AI Usage
Assisted-by: Pi Coding Agent:GPT-5.5
Submitted code was reviewed by a human: YES
The author is taking the responsibility for the contribution: YES
Summary by CodeRabbit
New Features
Bug Fixes