Skip to content

Conversation

@thchann
Copy link

@thchann thchann commented Nov 23, 2025

Description

This PR adds a community example notebook demonstrating lightweight real-time engagement classification using a Roboflow single-label classification model and a custom Workflow. The notebook walks through dataset preparation, hosted model training, Workflow creation, API-based inference, and live webcam prediction using OpenCV. The goal is to provide a reproducible, hosted alternative to heavyweight local pipelines (e.g., MARLIN + OpenFace) and show how Roboflow can enable simple real-time deployment without GPU dependencies.

This contribution implements a complete end-to-end example of hosted model deployment for engagement classification. It includes:

  • A Jupyter notebook (Facial_Metric_Inference.ipynb) demonstrating:
    • Preparing a small classification dataset using self-recorded frames
    • Training a Roboflow single-label classification model
    • Creating a custom Roboflow Workflow for simplified inference
    • Calling the Workflow through the InferenceHTTPClient API
    • Running live webcam inference using OpenCV
    • Displaying sample predictions and analysis
  • An assets/ folder containing representative prediction outputs
  • Supporting markdown cells explaining motivation, design decisions, and limitations

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

I tested the notebook by:

  1. Running each code cell locally on macOS with Python 3.10.
  2. Confirming that Workflow API calls returned valid JSON responses.
  3. Capturing live frames with OpenCV (cv2.VideoCapture) and sending them to the Workflow API.
  4. Verifying that the model produced correct predictions on unseen frames, including tests with another subject (roommate) and in different lighting conditions.
  5. Ensuring the notebook runs cleanly from top to bottom with no external repo dependencies.

Any specific deployment considerations

  1. Users must provide their own ROBOFLOW_API_KEY and ROBOFLOW_API_URL in a .env file.
  2. Webcam inference requires local camera access (not supported in headless Docker environments without additional configuration).
  3. Images included in the assets/ folder are lightweight and safe to commit.

Docs

  • The example notebook serves as documentation for using Workflows with live inference.

@CLAassistant
Copy link

CLAassistant commented Nov 23, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants