CtrlK
BlogDocsLog inGet started
Tessl Logo

jbaruch/vision-pipeline-foundations-kotlin

Hygiene for JavaCV + DJL vision pipelines on Kotlin/JVM: camera discovery and probing, frame-skip policy for heavy inference, downscale-before-detection. Replaces the Python jbaruch/vision-pipeline-foundations tile.

94

1.86x
Quality

93%

Does it follow best practices?

Impact

99%

1.86x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Optimizing a Real-Time Face Recognition Pipeline for Live Events

Problem/Feature Description

A company runs live-event check-in booths where a kiosk camera feeds into a Kotlin/JVM pipeline that matches attendees against a pre-registered face database. The current prototype runs face detection, face recognition, and emotion classification on every captured frame. On the demo hardware the CPU hits 95% utilization and the preview stream stutters noticeably, making the booth look unprofessional.

An engineer has profiled the pipeline and confirmed that the bottleneck is running all three inference stages at 30 frames per second when none of them need to operate that fast: face boxes in the preview barely move between consecutive frames, and emotions shift on a timescale of seconds, not milliseconds. The team needs the inference to run at a reduced cadence while the preview and camera capture continue to appear completely smooth. The solution must also address a separate quality issue: the Haar cascade face detector is producing a large number of false-positive rectangles on background textures and objects, and the team wants this cleaned up as part of the optimization work.

Write a Kotlin source file named pipeline.kt that implements the main capture-and-inference loop and any helper functions needed. Assume a grabber (OpenCVFrameGrabber) and cascade (CascadeClassifier) are already initialized. Include stub implementations (or clearly annotated TODOs) for any functions that depend on an external model (e.g. recognizeFace(), classifyEmotion()). Include a diagnostic function or log statement that reports the measured face-detection rate in Hz.

Output Specification

Produce a Kotlin source file pipeline.kt containing:

  • The main processing loop with appropriately gated inference calls
  • The face detection helper that handles the resolution correctly
  • Logic ensuring face boxes remain visible on-screen continuously even when detection is not running on every frame
  • A main() function or clearly labelled entry point that runs the loop
  • Diagnostic logging of face-detection frequency in Hz

evals

README.md

tile.json