Commit db09141e authored by Pamosha's avatar Pamosha

Eye gaze identification configuration.

parent 336656e3
...@@ -4,7 +4,7 @@ plugins { ...@@ -4,7 +4,7 @@ plugins {
android { android {
compileSdkVersion 30 compileSdkVersion 30
buildToolsVersion "30.0.2" buildToolsVersion "30.0.3"
defaultConfig { defaultConfig {
applicationId "com.app.smartphotoeditor" applicationId "com.app.smartphotoeditor"
...@@ -15,6 +15,9 @@ android { ...@@ -15,6 +15,9 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
lintOptions {
checkReleaseBuilds false
}
buildTypes { buildTypes {
release { release {
...@@ -40,17 +43,18 @@ dependencies { ...@@ -40,17 +43,18 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0' implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0-rc1' implementation 'org.tensorflow:tensorflow-lite-metadata:0.1.0-rc1'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.2.0' implementation 'org.tensorflow:tensorflow-lite-gpu:2.2.0'
implementation project(path: ':openCVLibrary343')
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'de.hdodenhof:circleimageview:3.1.0' implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.github.zjywill:roundedcornerimageview:1.1.0' implementation 'com.github.zjywill:roundedcornerimageview:1.1.0'
implementation 'com.google.android.material:material:1.3.0-alpha03' implementation 'com.google.android.material:material:1.4.0-beta01'
implementation 'com.wang.avi:library:2.1.3' implementation 'com.wang.avi:library:2.1.3'
//Tensorflow dependencies //Tensorflow dependencies
implementation 'org.tensorflow:tensorflow-lite-task-vision:0.1.0' implementation 'org.tensorflow:tensorflow-lite-task-vision:0.1.0'
implementation 'org.tensorflow:tensorflow-lite-task-text:0.1.0' implementation 'org.tensorflow:tensorflow-lite-task-text:0.1.0'
implementation 'org.tensorflow:tensorflow-lite-support:0.1.0' implementation 'org.tensorflow:tensorflow-lite-support:0.1.0'
implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly-SNAPSHOT' implementation 'org.tensorflow:tensorflow-lite:2.4.0'
//cameraX //cameraX
def cameraxVersion = "1.0.0-alpha02" def cameraxVersion = "1.0.0-alpha02"
...@@ -61,4 +65,4 @@ dependencies { ...@@ -61,4 +65,4 @@ dependencies {
testImplementation 'junit:junit:4.+' testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
} }
\ No newline at end of file
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.SmartPhotoEditor"> android:theme="@style/Theme.SmartPhotoEditor">
<service <activity android:name=".activities.CameraView">
android:name=".services.GestureDetection"
android:enabled="true"
android:exported="true"></service>
<activity android:name=".activities.EyeBlink">
</activity>
<activity android:name=".activities.EyeBlink"/>
<activity android:name=".activities.EnvironmentChecker">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
...@@ -28,7 +28,9 @@ ...@@ -28,7 +28,9 @@
</activity> </activity>
<activity <activity
android:name=".activities.SplashScreen" android:name=".activities.SplashScreen"
android:screenOrientation="portrait"></activity> android:screenOrientation="portrait">
</activity>
<activity android:name=".activities.EditorActivity" /> <activity android:name=".activities.EditorActivity" />
</application> </application>
......
package com.app.smartphotoeditor.models;
public class EyeDetectionResultSet
{
private int blackPixels;
private float brightnessLevel;
private int contourSize;
public EyeDetectionResultSet(){}
public int getBlackPixels() {
return blackPixels;
}
public int getContourSize() {
return contourSize;
}
public void setContourSize(int contourSize) {
this.contourSize = contourSize;
}
public void setBlackPixels(int blackPixels) {
this.blackPixels = blackPixels;
}
public float getBrightnessLevel() {
return brightnessLevel;
}
public void setBrightnessLevel(float brightnessLevel) {
this.brightnessLevel = brightnessLevel;
}
}
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".activities.CameraView">
<org.opencv.android.JavaCameraView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frame_Surface"/>
<ImageView
android:id="@+id/frame"
android:layout_width="100dp"
android:layout_height="130dp"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/left"
android:layout_width="100dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="@+id/frame"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/frame"
app:layout_constraintTop_toTopOf="@+id/frame" />
<ImageView
android:id="@+id/center"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginEnd="32dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/right" />
<ImageView
android:id="@+id/right"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginEnd="32dp"
android:scaleType="centerCrop"
app:layout_constraintBottom_toBottomOf="@+id/center"
app:layout_constraintEnd_toEndOf="parent" />
<TextView
android:id="@+id/view_point"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="View Point"
android:textColor="@android:color/black"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/center"
app:layout_constraintTop_toBottomOf="@+id/frame" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".activities.CameraView">
<org.opencv.android.JavaCameraView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frame_Surface"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.4"
android:background="@color/black"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="32dp"
android:fontFamily="@font/app_english_font"
android:gravity="start"
android:letterSpacing="0.1"
android:lineSpacingMultiplier="1.2"
android:text="Please wait\nwhile we asses\nyour environment"
android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/frame"
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_marginTop="32dp"
android:scaleType="centerCrop"
app:civ_border_color="@color/white"
app:civ_border_width="2dp"
android:src="@drawable/eye"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
android:fontFamily="@font/history"
android:gravity="center"
android:letterSpacing="0.1"
android:lineSpacingMultiplier="1.2"
android:text="Place your eye"
android:textAllCaps="true"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/frame" />
<ProgressBar
android:id="@+id/progress_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_marginTop="50dp"
android:layout_marginEnd="60dp"
android:progress="0"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView1" />
<TextView
android:id="@+id/view_point"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="View Point"
android:textColor="@android:color/white"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="@+id/frame_Surface"
app:layout_constraintTop_toBottomOf="@+id/frame" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment