synheart_emotion 0.2.3
synheart_emotion: ^0.2.3 copied to clipboard
On-device emotion inference from biosignals (HR/RR) for Flutter. Detects emotions (Amused, Calm, Stressed) using WESAD-trained ML models.
Changelog #
All notable changes to this package will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.3 - 2025-12-26 #
Fixed #
- Updated README dependency snippets and API reference to match the current package version and synchronous
consumeReady()API
0.2.2 - 2025-12-07 #
Changed #
- Made
consumeReady()method synchronous (removed async/await requirement) for API consistency across platforms (Python, Kotlin, Swift, Dart) - Updated
expectedFeatureCountfrom 5 to 3 to reflect actual model requirements (hr_mean, sdnn, rmssd)
Fixed #
- Fixed stream listener in
EmotionStreamto use synchronousconsumeReady()call
0.2.1 - 2025-11-10 #
Fixed #
- Fixed README.md version number to match current package version (0.2.1)
- Fixed README.md API documentation:
consumeReady()is now correctly documented asFuture<List<EmotionResult>>(async method) - Fixed README.md example code to properly use
awaitwithconsumeReady()calls - Fixed
EmotionErrorto properly implementExceptioninterface, resolvingonly_throw_errorslint warnings - Fixed directive ordering in library exports for better code organization
- Fixed Android example app
minSdkVersionto 24 to match ONNX Runtime requirements - Fixed CI/CD workflows to handle info-level linting issues gracefully
- Improved error handling in CI workflow's
all-checks-passedjob
Added #
- Added
.gitignorefile with comprehensive Flutter/Dart ignore patterns for build artifacts, IDE files, and OS-specific files
Changed #
- Updated CI workflows to use
--no-fatal-infosflag for static analysis, allowing info-level suggestions without failing builds - Enhanced CI error reporting with better diagnostics for failed jobs
0.2.0 - 2025-11-07 #
Breaking Changes #
- Removed
LinearSvmModelclass: TheLinearSvmModelclass andmodel_linear_svm.dartfile have been removed. The package now focuses exclusively on ONNX models. - Removed
json_linear_model.dartexport: The dead export forjson_linear_model.darthas been removed (file was missing). - Package structure change: Moved
lib/directory from repository root tosdks/flutter/lib/to follow proper Flutter package conventions.
Migration Guide #
If you were using LinearSvmModel, migrate to OnnxEmotionModel:
// Old (0.1.0)
import 'package:synheart_emotion/synheart_emotion.dart';
final model = LinearSvmModel.fromArrays(
modelId: 'wesad_emotion_v1_0',
version: '1.0',
labels: ['Amused', 'Calm', 'Stressed'],
featureNames: ['hr_mean', 'sdnn', 'rmssd'],
weights: [...],
biases: [...],
mu: {...},
sigma: {...},
);
final engine = EmotionEngine.fromPretrained(
config,
model: model,
);
// New (0.2.0)
import 'package:synheart_emotion/synheart_emotion.dart';
final model = await OnnxEmotionModel.loadFromAsset(
modelAssetPath: 'assets/ml/extratrees_wrist_all_v1_0.onnx',
metaAssetPath: 'assets/ml/extratrees_wrist_all_v1_0.meta.json',
);
final engine = EmotionEngine.fromPretrained(
config,
model: model,
);
Fixed #
- Fixed Flutter package structure:
lib/directory is now properly located insdks/flutter/lib/wherepubspec.yamlis located, enabling proper pub.dev publishing.
Changed #
- Package now exclusively uses ONNX models for emotion inference.
- Improved package structure alignment with Flutter package conventions.
0.1.0 - 2025-01-30 #
Added #
- Initial release of synheart_emotion Flutter package
EmotionEnginefor processing biosignal dataOnnxEmotionModelfor ONNX model loading and inferenceFeatureExtractorfor HRV feature extraction- Support for three emotion classes: Amused, Calm, Stressed
- Real-time emotion streaming with
EmotionStream - Comprehensive test suite