seeso_flutter 1.0.4
seeso_flutter: ^1.0.4 copied to clipboard
SeeSo SDK is a Eye tracking library that calculates where the user is looking at on the screen in real time using RGB image from the camera.
seeso_flutter #
SeeSo SDK Flutter plugin project.
SeeSo SDK
is a Eye Tracking library that calculates where the user is looking at on the screen in real time using RGB image from the camera.
All computation is done locally on the device.
Getting Started #
1. Install #
-
Check the Development key.
-
Create the new flutter project from terminal.
flutter create --platforms android,ios sample_app
-
Added
seeso_flutter
to sample_app'spubspec.yaml
file.dependencies: flutter: sdk: flutter seeso_flutter:^1.0.4
-
Install pub packge from terminal.
flutter pub get
Android #
-
Add the maven repository URL
https://seeso.jfrog.io/artifactory/visualcamp-seeso-android-gradle-release/
to the build.gradle file where seeso is located.allprojects { repositories { ... maven { url "https://seeso.jfrog.io/artifactory/visualcamp-seeso-android-gradle-release/" } } }
-
Add the following dependencies to the app/build.gradle file.
dependencies { ... implementation "camp.visual:seeso-gazetracker:latest.release" implementation "camp.visual:seeso-libgaze:latest.release" }
Environment Set-ups (iOS) #
-
Add permission to your Info.plist file.
<key>NSCameraUsageDescription</key> <string></string>
-
Add
PERMISSION_CAMERA=1
to your Podfile.target.build_configurations.each do |config| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)', ... 'PERMISSION_CAMERA=1' ] end
-
Pod install from terminal.
pod install
2. Obtain a License Key #
SeeSo SDK requires a License Key for operation. You can obtain the key from seeso.io.
3. How to use #
-
Add code to check if you have camera permission.
Future<void> checkCameraPermission() async { _hasCameraPermission = await _seesoPlugin.checkCameraPermission(); }
-
Add a function to request camera permission.
Future<void> checkCameraPermission() async { _hasCameraPermission = await _seesoPlugin.checkCameraPermission(); ///If you do not have camera permission, call the requesting function. if (!_hasCameraPermission) { _hasCameraPermission = await _seesoPlugin.requestCameraPermission(); } }
-
When camera permission is obtained through the user, authentication begins by calling the initGazeTracker function.
Future<void> initSeeSo() async { await checkCameraPermission(); String requestInitGazeTracker = "failed Request"; if (_hasCameraPermission) { try { InitializedResult? initializedResult = await _seesoPlugin.initGazeTracker(licenseKey: _licenseKey); } on PlatformException catch (e) { print( "Occur PlatformException (${e.message})"); } } }
-
When authentication is successful, eye tracking begins.
if (initializedResult!.result) { try { _seesoPlugin.startTracking(); } on PlatformException catch (e) { print("Occur PlatformException (${e.message})"); } }
-
Set a listener to receive GazeInfo.
_seesoPlugin.getGazeEvent().listen((event) { GazeInfo info = GazeInfo(event); if (info.trackingState == TrackingState.SUCCESS) { print("gaze info ${gazeInfo.x}, ${gazeInfo.y}"); } else { print("gaze not found"); } } );
API #
https://docs.seeso.io/docs/api/flutter-api-docs
Contact Us #
If you have any problems, feel free to development@visual.camp
License #
Copyright (c) VisualCamp. All rights reserved.