Repository navigation
Add standalone Python 3 / TF 2.15 port (no ROS) + fixed stale weights download URL - #8
Open
timotizianomeier wants to merge 4 commits into
Open
timotizianomeier wants to merge 4 commits into
timotizianomeier wants to merge 4 commits into
Conversation
Modernised, ROS-free port of the engagement detector so it runs on current systems (tested: Apple Silicon, Python 3.11, tensorflow-macos 2.15, the last Keras-2 release). ResNeXt50 comes from the archived keras-applications package; the pretrained LSTM h5 loads unchanged. Includes a live webcam demo and pinned requirements. Verified against the original pipeline: same preprocessing, same feature shapes, pretrained weights load without custom objects.
Wraps EngagementDetector behind POST /score (10 base64 JPEG frames -> engagement float) and GET /health on 127.0.0.1:8100, so apps in other Python environments can consume scores across the process boundary. Frames decode via cv2.imdecode (BGR), matching the validated webcam path. Loads models before binding; refuses stand-in weights unless --allow-standin. Round-trip test proves HTTP score equals direct predict (diff <1e-7) and covers the 400/404 error paths.
timotizianomeier
marked this pull request as ready for review
August 25, 2026 09:36
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.
Hi Francesco, following up on our email exchange, this is the Python 3 port I mentioned. Four commits, in three independent parts:
The original ROS package is untouched, everything lives alongside it. Happy to restructure (different folder name, drop the service, squash) or split this into separate PRs, whatever suits the repo. And absolutely fine if you'd rather keep upstream as-is, the fork serves my needs either way.
Context: I'm using this model (via your 2020 paper) in my MSc thesis on a socially assistive robot for students with ADHD at Imperial College London.