Zhen Ye Claude Opus 4.6 commited on
Commit
a0fe24f
·
1 Parent(s): b7410a3

perf: increase production keyframe step from 20 to 60

Browse files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (3) hide show
  1. app.py +3 -3
  2. jobs/background.py +1 -1
  3. utils/profiler.py +1 -1
app.py CHANGED
@@ -911,7 +911,7 @@ async def benchmark_endpoint(
911
  video: UploadFile = File(...),
912
  queries: str = Form("person,car,truck"),
913
  segmenter: str = Form("gsam2_large"),
914
- step: int = Form(20),
915
  num_maskmem: Optional[int] = Form(None),
916
  ):
917
  """Run instrumented GSAM2 pipeline and return latency breakdown JSON.
@@ -1040,7 +1040,7 @@ async def benchmark_profile(
1040
  queries: str = Form("person,car,truck"),
1041
  max_frames: int = Form(100),
1042
  warmup_frames: int = Form(5),
1043
- step: int = Form(20),
1044
  num_maskmem: Optional[int] = Form(None),
1045
  ):
1046
  """Run profiled inference and return per-frame timing breakdown.
@@ -1106,7 +1106,7 @@ async def benchmark_analysis(
1106
  queries: str = Form("person,car,truck"),
1107
  max_frames: int = Form(100),
1108
  warmup_frames: int = Form(5),
1109
- step: int = Form(20),
1110
  num_maskmem: Optional[int] = Form(None),
1111
  ):
1112
  """Full roofline analysis: hardware + profiling + theoretical ceilings + bottleneck ID.
 
911
  video: UploadFile = File(...),
912
  queries: str = Form("person,car,truck"),
913
  segmenter: str = Form("gsam2_large"),
914
+ step: int = Form(60),
915
  num_maskmem: Optional[int] = Form(None),
916
  ):
917
  """Run instrumented GSAM2 pipeline and return latency breakdown JSON.
 
1040
  queries: str = Form("person,car,truck"),
1041
  max_frames: int = Form(100),
1042
  warmup_frames: int = Form(5),
1043
+ step: int = Form(60),
1044
  num_maskmem: Optional[int] = Form(None),
1045
  ):
1046
  """Run profiled inference and return per-frame timing breakdown.
 
1106
  queries: str = Form("person,car,truck"),
1107
  max_frames: int = Form(100),
1108
  warmup_frames: int = Form(5),
1109
+ step: int = Form(60),
1110
  num_maskmem: Optional[int] = Form(None),
1111
  ):
1112
  """Full roofline analysis: hardware + profiling + theoretical ceilings + bottleneck ID.
jobs/background.py CHANGED
@@ -36,7 +36,7 @@ async def process_video_async(job_id: str) -> None:
36
  segmenter_name=job.segmenter_name,
37
  job_id=job_id,
38
  stream_queue=stream_queue,
39
- step=20,
40
  enable_gpt=job.enable_gpt,
41
  mission_spec=job.mission_spec,
42
  first_frame_gpt_results=job.first_frame_gpt_results,
 
36
  segmenter_name=job.segmenter_name,
37
  job_id=job_id,
38
  stream_queue=stream_queue,
39
+ step=60,
40
  enable_gpt=job.enable_gpt,
41
  mission_spec=job.mission_spec,
42
  first_frame_gpt_results=job.first_frame_gpt_results,
utils/profiler.py CHANGED
@@ -327,7 +327,7 @@ def run_profiled_segmentation(
327
  segmenter_name: str,
328
  queries: List[str],
329
  max_frames: int = 100,
330
- step: int = 20,
331
  num_maskmem: Optional[int] = None,
332
  ) -> ProfilingResult:
333
  """Run profiled segmentation (GSAM2) on a video file.
 
327
  segmenter_name: str,
328
  queries: List[str],
329
  max_frames: int = 100,
330
+ step: int = 60,
331
  num_maskmem: Optional[int] = None,
332
  ) -> ProfilingResult:
333
  """Run profiled segmentation (GSAM2) on a video file.