Skip to content

fix(enhancement): Added per stream fps threshold logic#236

Open
rishika-y-gaur wants to merge 5 commits into
intel-retail:mainfrom
rishika-y-gaur:I-235
Open

fix(enhancement): Added per stream fps threshold logic#236
rishika-y-gaur wants to merge 5 commits into
intel-retail:mainfrom
rishika-y-gaur:I-235

Conversation

@rishika-y-gaur

@rishika-y-gaur rishika-y-gaur commented Jul 17, 2026

Copy link
Copy Markdown

Evaluate stream density per camera target FPS so mixed-camera ASC bundles stop only when each stream meets its own threshold.

Resolves: #235

PR Checklist

  • Added label to the Pull Request for easier discoverability and search
  • Commit Message meets guidelines as indicated in the URL https://github.com/intel-retail/performance-tools/blob/main/CONTRIBUTING.md
  • Every commit is a single defect fix and does not mix feature addition or changes
  • Unit Tests have been added for new changes
  • Updated Documentation as relevant to the changes
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with repository license and clearly outlined the added dependency.
  • PR change contains code related to security
  • PR introduces changes that breaks compatibility with other modules (If YES, please provide details below)

What are you changing?

This PR updates stream-density stopping logic to use per-stream target FPS, so mixed-camera ASC bundles stop only when each stream meets its own threshold.

Issue this PR will close

close: #235

Anything the reviewer should know when reviewing this PR?

Per-stream pass/fail thresholds with hysteresis are now used instead of a single shared FPS target, and target FPS thresholds are taken from camera config JSON files.

Test Instructions if applicable

  • Use a camera config with different targetFps values per camera.
  • Run stream density benchmark.
  • Confirm each stream is checked against its own threshold before stopping.

If the there are associated PRs in other repositories, please link them here (i.e. intel-retail/performance-tools )

Evaluate stream density per camera target FPS so mixed-camera ASC bundles stop only when each stream meets its own threshold.

Resolves: intel-retail#235

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the stream-density benchmark’s stopping/scaling logic so mixed-camera bundles are evaluated against per-stream target FPS thresholds (derived from a camera config JSON), rather than using one shared FPS target for all streams.

Changes:

  • Add camera-config JSON parsing to build a per-stream targetFps map.
  • Update pass/fail + hysteresis evaluation to use per-stream thresholds.
  • Adjust increment estimation to use an aggregate (mean) of per-stream targets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py Outdated
Comment thread benchmark-scripts/stream_density.py Outdated
rishika-y-gaur and others added 2 commits July 17, 2026 12:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread benchmark-scripts/stream_density.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment on lines +732 to 737
average_target_fps = get_mean_target_fps(stream_target_fps, target_fps)
if os.getenv("STREAM_DENSITY_DEBUG", "0") == "1":
print('mean target fps:', average_target_fps)
increments = int(conservative_per_stream / average_target_fps)
if increments == 1:
increments = MAX_GUESS_INCREMENTS
print('fail_thresholds:', fail_thresholds)
print('passing_streams:', passing_streams)
print('failing_streams:', failing_streams)
print("INFO: All streams meet target" if all_streams_meet_target else "INFO: Not all streams meet target")
Comment on lines +74 to +79
missing_path = '/tmp/non-existent-camera-config-for-test.json'

with patch.dict(os.environ, {'CAMERA_STREAM': missing_path}, clear=False):
result = stream_density.build_per_stream_target_fps(
stream_fps_dict, default_target_fps=22.0
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Enhancement) Use-case density needs per-camera FPS thresholds

2 participants