ENT-969: Add TestPatternStreamProducer as a built-in video source type#2056
Merged
PawelPeczek-Roboflow merged 3 commits intomainfrom Mar 6, 2026
Merged
ENT-969: Add TestPatternStreamProducer as a built-in video source type#2056PawelPeczek-Roboflow merged 3 commits intomainfrom
PawelPeczek-Roboflow merged 3 commits intomainfrom
Conversation
Adds a synthetic 1920x1080 test pattern with colored grid and live clock. Resolution happens in VideoSource._start alongside the existing callable and CV2 dispatch, keeping all producer types in one place. Made-with: Cursor
3348763 to
d81a8fe
Compare
dkosowski87
approved these changes
Mar 5, 2026
Contributor
dkosowski87
left a comment
There was a problem hiding this comment.
Do we plan to check it manually or through some automatic tests? I'm wondering whether it wouldn't be better to move the test_pattern_producer to the test directory, so it doesn't pollute the core inference scope. WDYT?
PawelPeczek-Roboflow
approved these changes
Mar 6, 2026
Collaborator
|
Probably |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a synthetic 1920x1080 test pattern with colored grid and live clock
Type of Change
Testing
also tested with full changes in roboflow app and inference for manufacturing on a local jetson device.
Test details:
test_is_test_pattern_reference_accepts_valid_and_rejects_invalid -- Verifies the guard function correctly identifies "TestPatternStreamProducer" strings (with whitespace/suffixes) and rejects integers, RTSP URLs, partial matches, and empty strings.
test_generate_frame_produces_valid_image -- Confirms the frame generator outputs a 1920x1080 BGR uint8 image that isn't all black.
test_discover_source_properties_for_test_pattern -- Checks the producer reports correct width, height, fps, is_file=False, and is_reconnectable=True.
test_video_source_starts_and_reads_frames_from_test_pattern -- End-to-end: passes "TestPatternStreamProducer" as a video reference to VideoSource, starts the stream, reads a frame, and verifies the source is RUNNING with stream-mode buffer strategies.
Checklist
Additional Context