Repository: Kristina-Simakova/arfaces
Branch: master
Commit: ccdc12669a98
Files: 50
Total size: 64.0 KB
Directory structure:
gitextract_rgusjmyx/
├── .gitignore
├── LICENSE
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── proguard-rules.pro
│ ├── sampledata/
│ │ ├── sunglasses.fbx
│ │ ├── sunglasses.sfa
│ │ ├── yellow_sunglasses.fbx
│ │ └── yellow_sunglasses.sfa
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ └── no/
│ │ └── realitylab/
│ │ └── arface/
│ │ └── ExampleInstrumentedTest.kt
│ ├── main/
│ │ ├── AndroidManifest.xml
│ │ ├── assets/
│ │ │ ├── sunglasses.sfb
│ │ │ └── yellow_sunglasses.sfb
│ │ ├── java/
│ │ │ └── no/
│ │ │ └── realitylab/
│ │ │ └── arface/
│ │ │ ├── CustomFaceNode.kt
│ │ │ ├── FaceArFragment.kt
│ │ │ ├── FaceLandmarksActivity.kt
│ │ │ ├── FaceRegionsActivity.kt
│ │ │ ├── FilterFace.kt
│ │ │ ├── GlassesActivity.kt
│ │ │ ├── MainActivity.kt
│ │ │ └── MakeupActivity.kt
│ │ └── res/
│ │ ├── drawable/
│ │ │ ├── ic_autorenew_black_24dp.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ └── rounded_bg.xml
│ │ ├── drawable-v24/
│ │ │ └── ic_launcher_foreground.xml
│ │ ├── layout/
│ │ │ ├── activity_glasses.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── activity_makeup.xml
│ │ │ ├── activity_regions.xml
│ │ │ ├── card_layout.xml
│ │ │ └── element_layout.xml
│ │ ├── mipmap-anydpi-v26/
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ └── values/
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test/
│ └── java/
│ └── no/
│ └── realitylab/
│ └── arface/
│ └── ExampleUnitTest.kt
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches
# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Google Services (e.g. APIs or Firebase)
google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2019 Kristina Simakova
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Augmented Faces ARCore tutorials
Augmented Faces for Android
<b> Try-On makeup with Augmented Faces </b> <br/>
Blog post -> https://kristisimakova.medium.com/try-on-makeup-with-augmented-faces-d2ade1906f90
<br/>
<br/>
<b> Try-On glasses with Augmented Faces </b> <br/>
Blog post -> https://www.droid-girl.dev/blog/06gzoflzz25nqobt6ucp8rjzmlj5h6
<br/>
<br/>
<b> Instagram - like filter "Which ... are you?" with Augmented Faces </b> <br/>
Blog post -> https://www.droid-girl.dev/blog/y3ml70veq0xtpmjjwsf00t1mclhau8
<br/>
<br/>
<b> Face Landmarks for ARCore Augmented Faces </b> <br/>
Blog post -> https://www.droid-girl.dev/blog/hhgda2z2j6u27pdh95om0xggx42p7x
================================================
FILE: app/.gitignore
================================================
/build
================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
defaultConfig {
applicationId "no.realitylab.arface"
minSdkVersion 24
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "com.google.ar.sceneform.ux:sceneform-ux:1.14.0"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
apply plugin: 'com.google.ar.sceneform.plugin'
sceneform.asset('sampledata/sunglasses.fbx',
'default',
'sampledata/sunglasses.sfa',
'src/main/assets/sunglasses')
sceneform.asset('sampledata/yellow_sunglasses.fbx',
'default',
'sampledata/yellow_sunglasses.sfa',
'src/main/assets/yellow_sunglasses')
================================================
FILE: app/gradle/wrapper/gradle-wrapper.properties
================================================
#Fri Dec 27 19:32:10 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip
================================================
FILE: app/gradle.properties
================================================
android.enableJetifier=true
android.useAndroidX=true
================================================
FILE: app/gradlew
================================================
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
================================================
FILE: app/gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
================================================
FILE: app/sampledata/sunglasses.sfa
================================================
{
animations: [
{
path: 'sampledata/sunglasses.fbx',
},
],
materials: [
{
name: '1A1A1A.001',
parameters: [
{
baseColor: [
0.101961,
0.101961,
0.101961,
1,
],
},
{
baseColorMap: null,
},
{
normalMap: null,
},
{
interpolatedColor: null,
},
{
metallic: 0,
},
{
metallicMap: null,
},
{
roughness: 1,
},
{
roughnessMap: null,
},
{
opacity: null,
},
],
source: 'build/sceneform_sdk/default_materials/fbx_material.sfm',
},
],
model: {
attributes: [
'Position',
'Orientation',
'BoneIndices',
'BoneWeights',
],
collision: {},
file: 'sampledata/sunglasses.fbx',
name: 'sunglasses',
recenter: 'root',
},
version: '0.54:2',
}
================================================
FILE: app/sampledata/yellow_sunglasses.sfa
================================================
{
animations: [
{
path: 'sampledata/yellow_sunglasses.fbx',
},
],
materials: [
{
name: 'body',
parameters: [
{
baseColor: [
0.98101300000000002,
0.67214600000000002,
0,
1,
],
},
{
baseColorMap: null,
},
{
normalMap: null,
},
{
interpolatedColor: null,
},
{
metallic: 0,
},
{
metallicMap: null,
},
{
roughness: 1,
},
{
roughnessMap: null,
},
{
opacity: null,
},
],
source: 'build/sceneform_sdk/default_materials/fbx_material.sfm',
},
],
model: {
attributes: [
'Position',
'TexCoord',
'Orientation',
'BoneIndices',
'BoneWeights',
],
collision: {},
file: 'sampledata/yellow_sunglasses.fbx',
name: 'yellow_sunglasses',
recenter: 'root',
},
version: '0.54:2',
}
================================================
FILE: app/src/androidTest/java/no/realitylab/arface/ExampleInstrumentedTest.kt
================================================
package no.realitylab.arface
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("no.realitylab.arface", appContext.packageName)
}
}
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="no.realitylab.arface">
<uses-permission android:name="android.permission.CAMERA" />
<!-- This tag indicates that this application requires ARCore. This results in the application
only being visible in the Google Play Store on devices that support ARCore. -->
<uses-feature android:name="android.hardware.camera.ar" android:required="true"/>
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="false"
tools:ignore="GoogleAppIndexingWarning"
android:theme="@style/AppTheme">
<meta-data android:name="com.google.ar.core" android:value="required" />
<activity android:name=".MainActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:screenOrientation="locked"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".MakeupActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:screenOrientation="locked"/>
<activity android:name=".GlassesActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:screenOrientation="locked"/>
<activity android:name=".FaceRegionsActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:screenOrientation="locked"/>
<activity android:name=".FaceLandmarksActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:screenOrientation="locked"/>
</application>
</manifest>
================================================
FILE: app/src/main/java/no/realitylab/arface/CustomFaceNode.kt
================================================
package no.realitylab.arface
import android.content.Context
import android.widget.ImageView
import com.google.ar.core.AugmentedFace
import com.google.ar.sceneform.FrameTime
import com.google.ar.sceneform.Node
import com.google.ar.sceneform.math.Quaternion
import com.google.ar.sceneform.math.Vector3
import com.google.ar.sceneform.rendering.ViewRenderable
import com.google.ar.sceneform.ux.AugmentedFaceNode
class CustomFaceNode(augmentedFace: AugmentedFace?,
val context: Context
): AugmentedFaceNode(augmentedFace) {
private var eyeNodeLeft: Node? = null
private var eyeNodeRight: Node? = null
private var mustacheNode: Node? = null
companion object {
enum class FaceRegion {
LEFT_EYE,
RIGHT_EYE,
MUSTACHE
}
}
override fun onActivate() {
super.onActivate()
eyeNodeLeft = Node()
eyeNodeLeft?.setParent(this)
eyeNodeRight = Node()
eyeNodeRight?.setParent(this)
mustacheNode = Node()
mustacheNode?.setParent(this)
ViewRenderable.builder()
.setView(context, R.layout.element_layout)
.build()
.thenAccept { uiRenderable: ViewRenderable ->
uiRenderable.isShadowCaster = false
uiRenderable.isShadowReceiver = false
eyeNodeLeft?.renderable = uiRenderable
eyeNodeRight?.renderable = uiRenderable
}
.exceptionally { throwable: Throwable? ->
throw AssertionError(
"Could not create ui element",
throwable
)
}
ViewRenderable.builder()
.setView(context, R.layout.element_layout)
.build()
.thenAccept { uiRenderable: ViewRenderable ->
uiRenderable.isShadowCaster = false
uiRenderable.isShadowReceiver = false
mustacheNode?.renderable = uiRenderable
uiRenderable.view.findViewById<ImageView>(R.id.element_image).setImageResource(R.drawable.mustache)
}
.exceptionally { throwable: Throwable? ->
throw AssertionError(
"Could not create ui element",
throwable
)
}
}
private fun getRegionPose(region: FaceRegion) : Vector3? {
val buffer = augmentedFace?.meshVertices
if (buffer != null) {
return when (region) {
FaceRegion.LEFT_EYE ->
Vector3(buffer.get(374 * 3),buffer.get(374 * 3 + 1), buffer.get(374 * 3 + 2))
FaceRegion.RIGHT_EYE ->
Vector3(buffer.get(145 * 3),buffer.get(145 * 3 + 1), buffer.get(145 * 3 + 2))
FaceRegion.MUSTACHE ->
Vector3(buffer.get(11 * 3),
buffer.get(11 * 3 + 1),
buffer.get(11 * 3 + 2))
}
}
return null
}
override fun onUpdate(frameTime: FrameTime?) {
super.onUpdate(frameTime)
augmentedFace?.let {face ->
getRegionPose(FaceRegion.LEFT_EYE)?.let {
eyeNodeLeft?.localPosition = Vector3(it.x, it.y - 0.035f, it.z + 0.015f)
eyeNodeLeft?.localScale = Vector3(0.055f, 0.055f, 0.055f)
eyeNodeLeft?.localRotation = Quaternion.axisAngle(Vector3(0.0f, 0.0f, 1.0f), -10f)
}
getRegionPose(FaceRegion.RIGHT_EYE)?.let {
eyeNodeRight?.localPosition = Vector3(it.x, it.y - 0.035f, it.z + 0.015f)
eyeNodeRight?.localScale = Vector3(0.055f, 0.055f, 0.055f)
eyeNodeRight?.localRotation = Quaternion.axisAngle(Vector3(0.0f, 0.0f, 1.0f), 10f)
}
getRegionPose(FaceRegion.MUSTACHE)?.let {
mustacheNode?.localPosition = Vector3(it.x, it.y - 0.035f, it.z + 0.015f)
mustacheNode?.localScale = Vector3(0.07f, 0.07f, 0.07f)
}
}
}
}
================================================
FILE: app/src/main/java/no/realitylab/arface/FaceArFragment.kt
================================================
package no.realitylab.arface
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.google.ar.core.Config
import com.google.ar.core.Session
import com.google.ar.sceneform.ux.ArFragment
import java.util.*
public class FaceArFragment : ArFragment() {
override fun getSessionConfiguration(session: Session?): Config {
val config = Config(session)
config.augmentedFaceMode = Config.AugmentedFaceMode.MESH3D
return config
}
override fun getSessionFeatures(): MutableSet<Session.Feature> {
return EnumSet.of(Session.Feature.FRONT_CAMERA)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val frameLayout = super.onCreateView(inflater, container, savedInstanceState) as? FrameLayout
planeDiscoveryController.hide()
planeDiscoveryController.setInstructionView(null)
return frameLayout
}
}
================================================
FILE: app/src/main/java/no/realitylab/arface/FaceLandmarksActivity.kt
================================================
package no.realitylab.arface
import android.app.ActivityManager
import android.content.Context
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.ar.core.ArCoreApk
import com.google.ar.core.AugmentedFace
import com.google.ar.core.TrackingState
import com.google.ar.sceneform.rendering.Renderable
import kotlinx.android.synthetic.main.activity_regions.*
class FaceLandmarksActivity : AppCompatActivity() {
companion object {
const val MIN_OPENGL_VERSION = 3.0
}
lateinit var arFragment: FaceArFragment
var faceNodeMap = HashMap<AugmentedFace, CustomFaceNode>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!checkIsSupportedDeviceOrFinish()) {
return
}
setContentView(R.layout.activity_regions)
arFragment = face_fragment as FaceArFragment
button_refresh.visibility = View.GONE
val sceneView = arFragment.arSceneView
sceneView.cameraStreamRenderPriority = Renderable.RENDER_PRIORITY_FIRST
val scene = sceneView.scene
scene.addOnUpdateListener {
sceneView.session
?.getAllTrackables(AugmentedFace::class.java)?.let {
for (f in it) {
if (!faceNodeMap.containsKey(f)) {
val faceNode = CustomFaceNode(f, this)
faceNode.setParent(scene)
faceNodeMap.put(f, faceNode)
}
}
// Remove any AugmentedFaceNodes associated with an AugmentedFace that stopped tracking.
val iter = faceNodeMap.entries.iterator()
while (iter.hasNext()) {
val entry = iter.next()
val face = entry.key
if (face.trackingState == TrackingState.STOPPED) {
val faceNode = entry.value
faceNode.setParent(null)
iter.remove()
}
}
}
}
}
private fun checkIsSupportedDeviceOrFinish() : Boolean {
if (ArCoreApk.getInstance().checkAvailability(this) == ArCoreApk.Availability.UNSUPPORTED_DEVICE_NOT_CAPABLE) {
Toast.makeText(this, "Augmented Faces requires ARCore", Toast.LENGTH_LONG).show()
finish()
return false
}
val openGlVersionString = (getSystemService(Context.ACTIVITY_SERVICE) as? ActivityManager)
?.deviceConfigurationInfo
?.glEsVersion
openGlVersionString?.let { s ->
if (java.lang.Double.parseDouble(openGlVersionString) < MIN_OPENGL_VERSION) {
Toast.makeText(this, "Sceneform requires OpenGL ES 3.0 or later", Toast.LENGTH_LONG)
.show()
finish()
return false
}
}
return true
}
}
================================================
FILE: app/src/main/java/no/realitylab/arface/FaceRegionsActivity.kt
================================================
package no.realitylab.arface
import android.app.ActivityManager
import android.content.Context
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.ar.core.ArCoreApk
import com.google.ar.core.AugmentedFace
import com.google.ar.core.TrackingState
import com.google.ar.sceneform.rendering.Renderable
import kotlinx.android.synthetic.main.activity_regions.*
class FaceRegionsActivity : AppCompatActivity() {
companion object {
const val MIN_OPENGL_VERSION = 3.0
}
lateinit var arFragment: FaceArFragment
var faceNodeMap = HashMap<AugmentedFace, FilterFace>()
var refresh: Boolean = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!checkIsSupportedDeviceOrFinish()) {
return
}
setContentView(R.layout.activity_regions)
arFragment = face_fragment as FaceArFragment
val sceneView = arFragment.arSceneView
sceneView.cameraStreamRenderPriority = Renderable.RENDER_PRIORITY_FIRST
val scene = sceneView.scene
scene.addOnUpdateListener {
sceneView.session
?.getAllTrackables(AugmentedFace::class.java)?.let {
for (f in it) {
if (!faceNodeMap.containsKey(f)) {
val faceNode = FilterFace(f, this)
faceNode.setParent(scene)
faceNodeMap.put(f, faceNode)
}
}
// Remove any AugmentedFaceNodes associated with an AugmentedFace that stopped tracking.
val iter = faceNodeMap.entries.iterator()
while (iter.hasNext()) {
val entry = iter.next()
val face = entry.key
if (face.trackingState == TrackingState.STOPPED) {
val faceNode = entry.value
faceNode.setParent(null)
iter.remove()
}
}
}
}
button_refresh.setOnClickListener {
if (!refresh) {
startQuiz()
} else {
refresh()
}
refresh = !refresh
}
}
private fun startQuiz() {
for (face in faceNodeMap.values) {
face.animate()
}
}
private fun refresh() {
for (face in faceNodeMap.values) {
face.refresh()
}
}
private fun checkIsSupportedDeviceOrFinish() : Boolean {
if (ArCoreApk.getInstance().checkAvailability(this) == ArCoreApk.Availability.UNSUPPORTED_DEVICE_NOT_CAPABLE) {
Toast.makeText(this, "Augmented Faces requires ARCore", Toast.LENGTH_LONG).show()
finish()
return false
}
val openGlVersionString = (getSystemService(Context.ACTIVITY_SERVICE) as? ActivityManager)
?.deviceConfigurationInfo
?.glEsVersion
openGlVersionString?.let { s ->
if (java.lang.Double.parseDouble(openGlVersionString) < MIN_OPENGL_VERSION) {
Toast.makeText(this, "Sceneform requires OpenGL ES 3.0 or later", Toast.LENGTH_LONG)
.show()
finish()
return false
}
}
return true
}
}
================================================
FILE: app/src/main/java/no/realitylab/arface/FilterFace.kt
================================================
package no.realitylab.arface
import android.content.Context
import android.os.Handler
import android.widget.TextView
import com.google.ar.core.AugmentedFace
import com.google.ar.sceneform.FrameTime
import com.google.ar.sceneform.Node
import com.google.ar.sceneform.math.Vector3
import com.google.ar.sceneform.rendering.*
import com.google.ar.sceneform.ux.AugmentedFaceNode
class FilterFace(augmentedFace: AugmentedFace?,
val context: Context): AugmentedFaceNode(augmentedFace) {
private var cardNode: Node? = null
private var textView: TextView? = null
private lateinit var mHandler: Handler
private lateinit var mRunnable:Runnable
val animals = arrayOf("Dog", "Cat", "Tiger", "Frog", "Zebra", "Monkey", "Lion")
override fun onActivate() {
super.onActivate()
cardNode = Node()
cardNode?.setParent(this)
mHandler = Handler()
ViewRenderable.builder()
.setView(context, R.layout.card_layout)
.build()
.thenAccept { uiRenderable: ViewRenderable ->
uiRenderable.isShadowCaster = false
uiRenderable.isShadowReceiver = false
cardNode?.renderable = uiRenderable
textView = uiRenderable.view.findViewById(R.id.title)
}
.exceptionally { throwable: Throwable? ->
throw AssertionError(
"Could not create ui element",
throwable
)
}
}
override fun onUpdate(frameTime: FrameTime?) {
super.onUpdate(frameTime)
augmentedFace?.let {face ->
val rightForehead = face.getRegionPose(AugmentedFace.RegionType.FOREHEAD_RIGHT)
val leftForehead = face.getRegionPose(AugmentedFace.RegionType.FOREHEAD_LEFT)
val center = face.centerPose
cardNode?.worldPosition = Vector3((leftForehead.tx() + rightForehead.tx()) / 2,
(leftForehead.ty() + rightForehead.ty()) / 2 + 0.05f , center.tz())
}
}
fun animate() {
val index = (animals.indices).random()
val rounds = (2..4).random()
var currentIndex = 0
var currentRound = 0
mRunnable = Runnable {
textView?.text = animals[currentIndex]
currentIndex ++
if (currentIndex == animals.size) {
currentIndex = 0
currentRound ++
}
if (currentRound == rounds) {
textView?.text = animals[index]
} else {
// Schedule the task to repeat
mHandler.postDelayed(
mRunnable, // Runnable
100 // Delay in milliseconds
)
}
}
// Schedule the task to repeat
mHandler.postDelayed(
mRunnable, // Runnable
100 // Delay in milliseconds
)
}
fun refresh() {
textView?.text = context.getText(R.string.quiz_title)
}
}
================================================
FILE: app/src/main/java/no/realitylab/arface/GlassesActivity.kt
================================================
package no.realitylab.arface
import android.app.ActivityManager
import android.content.Context
import android.net.Uri
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.ar.core.ArCoreApk
import com.google.ar.core.AugmentedFace
import com.google.ar.core.TrackingState
import com.google.ar.sceneform.rendering.ModelRenderable
import com.google.ar.sceneform.rendering.Renderable
import com.google.ar.sceneform.rendering.Texture
import com.google.ar.sceneform.ux.AugmentedFaceNode
import kotlinx.android.synthetic.main.activity_glasses.*
import java.util.ArrayList
class GlassesActivity : AppCompatActivity() {
companion object {
const val MIN_OPENGL_VERSION = 3.0
}
lateinit var arFragment: FaceArFragment
private var faceMeshTexture: Texture? = null
private var glasses: ArrayList<ModelRenderable> = ArrayList()
private var faceRegionsRenderable: ModelRenderable? = null
var faceNodeMap = HashMap<AugmentedFace, AugmentedFaceNode>()
private var index: Int = 0
private var changeModel: Boolean = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!checkIsSupportedDeviceOrFinish()) {
return
}
setContentView(R.layout.activity_glasses)
button_next.setOnClickListener {
changeModel = !changeModel
index++
if (index > glasses.size - 1) {
index = 0
}
faceRegionsRenderable = glasses.get(index)
}
arFragment = face_fragment as FaceArFragment
Texture.builder()
.setSource(this, R.drawable.makeup)
.build()
.thenAccept { texture -> faceMeshTexture = texture }
ModelRenderable.builder()
.setSource(this, Uri.parse("yellow_sunglasses.sfb"))
.build()
.thenAccept { modelRenderable ->
glasses.add(modelRenderable)
faceRegionsRenderable = modelRenderable
modelRenderable.isShadowCaster = false
modelRenderable.isShadowReceiver = false
}
ModelRenderable.builder()
.setSource(this, Uri.parse("sunglasses.sfb"))
.build()
.thenAccept { modelRenderable ->
glasses.add(modelRenderable)
modelRenderable.isShadowCaster = false
modelRenderable.isShadowReceiver = false
}
val sceneView = arFragment.arSceneView
sceneView.cameraStreamRenderPriority = Renderable.RENDER_PRIORITY_FIRST
val scene = sceneView.scene
scene.addOnUpdateListener {
if (faceRegionsRenderable != null) {
sceneView.session
?.getAllTrackables(AugmentedFace::class.java)?.let {
for (f in it) {
if (!faceNodeMap.containsKey(f)) {
val faceNode = AugmentedFaceNode(f)
faceNode.setParent(scene)
faceNode.faceRegionsRenderable = faceRegionsRenderable
faceNodeMap.put(f, faceNode)
} else if (changeModel) {
faceNodeMap.getValue(f).faceRegionsRenderable = faceRegionsRenderable
}
}
changeModel = false
// Remove any AugmentedFaceNodes associated with an AugmentedFace that stopped tracking.
val iter = faceNodeMap.entries.iterator()
while (iter.hasNext()) {
val entry = iter.next()
val face = entry.key
if (face.trackingState == TrackingState.STOPPED) {
val faceNode = entry.value
faceNode.setParent(null)
iter.remove()
}
}
}
}
}
}
fun checkIsSupportedDeviceOrFinish() : Boolean {
if (ArCoreApk.getInstance().checkAvailability(this) == ArCoreApk.Availability.UNSUPPORTED_DEVICE_NOT_CAPABLE) {
Toast.makeText(this, "Augmented Faces requires ARCore", Toast.LENGTH_LONG).show()
finish()
return false
}
val openGlVersionString = (getSystemService(Context.ACTIVITY_SERVICE) as? ActivityManager)
?.deviceConfigurationInfo
?.glEsVersion
openGlVersionString?.let { s ->
if (java.lang.Double.parseDouble(openGlVersionString) < MIN_OPENGL_VERSION) {
Toast.makeText(this, "Sceneform requires OpenGL ES 3.0 or later", Toast.LENGTH_LONG)
.show()
finish()
return false
}
}
return true
}
}
================================================
FILE: app/src/main/java/no/realitylab/arface/MainActivity.kt
================================================
package no.realitylab.arface
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
button_makeup.setOnClickListener {
startActivity(Intent(this, MakeupActivity::class.java))
}
button_glasses.setOnClickListener {
startActivity(Intent(this, GlassesActivity::class.java))
}
button_regions.setOnClickListener {
startActivity(Intent(this, FaceRegionsActivity::class.java))
}
button_face_landmarks.setOnClickListener {
startActivity(Intent(this, FaceLandmarksActivity::class.java))
}
}
}
================================================
FILE: app/src/main/java/no/realitylab/arface/MakeupActivity.kt
================================================
package no.realitylab.arface
import android.app.ActivityManager
import android.content.Context
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.ar.core.ArCoreApk
import com.google.ar.core.AugmentedFace
import com.google.ar.core.TrackingState
import com.google.ar.sceneform.rendering.Renderable
import com.google.ar.sceneform.rendering.Texture
import com.google.ar.sceneform.ux.AugmentedFaceNode
import kotlinx.android.synthetic.main.activity_makeup.*
class MakeupActivity : AppCompatActivity() {
companion object {
const val MIN_OPENGL_VERSION = 3.0
}
lateinit var arFragment: FaceArFragment
private var faceMeshTexture: Texture? = null
var faceNodeMap = HashMap<AugmentedFace, AugmentedFaceNode>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!checkIsSupportedDeviceOrFinish()) {
return
}
setContentView(R.layout.activity_makeup)
arFragment = face_fragment as FaceArFragment
Texture.builder()
.setSource(this, R.drawable.makeup)
.build()
.thenAccept { texture -> faceMeshTexture = texture }
val sceneView = arFragment.arSceneView
sceneView.cameraStreamRenderPriority = Renderable.RENDER_PRIORITY_FIRST
val scene = sceneView.scene
scene.addOnUpdateListener {
faceMeshTexture.let {
sceneView.session
?.getAllTrackables(AugmentedFace::class.java)?.let {
for (f in it) {
if (!faceNodeMap.containsKey(f)) {
val faceNode = AugmentedFaceNode(f)
faceNode.setParent(scene)
faceNode.faceMeshTexture = faceMeshTexture
faceNodeMap.put(f, faceNode)
}
}
// Remove any AugmentedFaceNodes associated with an AugmentedFace that stopped tracking.
val iter = faceNodeMap.entries.iterator()
while (iter.hasNext()) {
val entry = iter.next()
val face = entry.key
if (face.trackingState == TrackingState.STOPPED) {
val faceNode = entry.value
faceNode.setParent(null)
iter.remove()
}
}
}
}
}
}
fun checkIsSupportedDeviceOrFinish() : Boolean {
if (ArCoreApk.getInstance().checkAvailability(this) == ArCoreApk.Availability.UNSUPPORTED_DEVICE_NOT_CAPABLE) {
Toast.makeText(this, "Augmented Faces requires ARCore", Toast.LENGTH_LONG).show()
finish()
return false
}
val openGlVersionString = (getSystemService(Context.ACTIVITY_SERVICE) as? ActivityManager)
?.deviceConfigurationInfo
?.glEsVersion
openGlVersionString?.let { s ->
if (java.lang.Double.parseDouble(openGlVersionString) < MIN_OPENGL_VERSION) {
Toast.makeText(this, "Sceneform requires OpenGL ES 3.0 or later", Toast.LENGTH_LONG)
.show()
finish()
return false
}
}
return true
}
}
================================================
FILE: app/src/main/res/drawable/ic_autorenew_black_24dp.xml
================================================
<vector android:height="24dp" android:tint="#D3D3D3"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,6v3l4,-4 -4,-4v3c-4.42,0 -8,3.58 -8,8 0,1.57 0.46,3.03 1.24,4.26L6.7,14.8c-0.45,-0.83 -0.7,-1.79 -0.7,-2.8 0,-3.31 2.69,-6 6,-6zM18.76,7.74L17.3,9.2c0.44,0.84 0.7,1.79 0.7,2.8 0,3.31 -2.69,6 -6,6v-3l-4,4 4,4v-3c4.42,0 8,-3.58 8,-8 0,-1.57 -0.46,-3.03 -1.24,-4.26z"/>
</vector>
================================================
FILE: app/src/main/res/drawable/ic_launcher_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>
================================================
FILE: app/src/main/res/drawable/rounded_bg.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ff6600"/>
<corners android:radius="20dp"/>
</shape>
================================================
FILE: app/src/main/res/drawable-v24/ic_launcher_foreground.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0"/>
<item
android:color="#00000000"
android:offset="1.0"/>
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1"/>
</vector>
================================================
FILE: app/src/main/res/layout/activity_glasses.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".GlassesActivity">
<fragment android:name="no.realitylab.arface.FaceArFragment"
android:id="@+id/face_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageButton
android:id="@+id/button_next"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_margin="24dp"
android:src="@drawable/ic_autorenew_black_24dp"
android:layout_gravity="bottom|center_horizontal"
android:background="@null"/>
</FrameLayout>
================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
tools:context=".MainActivity">
<Button
android:id="@+id/button_makeup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/makeup" />
<Button
android:id="@+id/button_glasses"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/glasses" />
<Button
android:id="@+id/button_regions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/regions" />
<Button
android:id="@+id/button_face_landmarks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/face_landmarks" />
</LinearLayout>
================================================
FILE: app/src/main/res/layout/activity_makeup.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MakeupActivity">
<fragment android:name="no.realitylab.arface.FaceArFragment"
android:id="@+id/face_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
================================================
FILE: app/src/main/res/layout/activity_regions.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FaceRegionsActivity">
<fragment android:name="no.realitylab.arface.FaceArFragment"
android:id="@+id/face_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageButton
android:id="@+id/button_refresh"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="24dp"
android:src="@drawable/ic_autorenew_black_24dp"
android:layout_gravity="bottom|center_horizontal"
android:background="@null"/>
</FrameLayout>
================================================
FILE: app/src/main/res/layout/card_layout.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:background="@drawable/rounded_bg"
android:layout_height="wrap_content"
android:clipChildren="false"
android:padding="8dp"
android:gravity="center"
android:clipToPadding="false">
<TextView
android:id="@+id/title"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textSize="8sp"
android:text="@string/quiz_title"
android:padding="8dp"/>
</LinearLayout>
================================================
FILE: app/src/main/res/layout/element_layout.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:gravity="center"
android:clipToPadding="false">
<ImageView
android:id="@+id/element_image"
android:src="@drawable/star_eye"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
</resources>
================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
<string name="app_name">arface</string>
<string name="makeup">Makeup tutorial</string>
<string name="glasses">Glasses tutorial</string>
<string name="regions">Quiz tutorial</string>
<string name="face_landmarks">Face landmarks</string>
<string name="quiz_title">What animal are you?</string>
</resources>
================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
================================================
FILE: app/src/test/java/no/realitylab/arface/ExampleUnitTest.kt
================================================
package no.realitylab.arface
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.ar.sceneform:plugin:1.14.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenLocal()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Sat Jul 06 09:14:13 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
================================================
FILE: gradlew
================================================
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: settings.gradle
================================================
include ':app'
gitextract_rgusjmyx/ ├── .gitignore ├── LICENSE ├── README.md ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── gradle/ │ │ └── wrapper/ │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── gradlew │ ├── gradlew.bat │ ├── proguard-rules.pro │ ├── sampledata/ │ │ ├── sunglasses.fbx │ │ ├── sunglasses.sfa │ │ ├── yellow_sunglasses.fbx │ │ └── yellow_sunglasses.sfa │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── no/ │ │ └── realitylab/ │ │ └── arface/ │ │ └── ExampleInstrumentedTest.kt │ ├── main/ │ │ ├── AndroidManifest.xml │ │ ├── assets/ │ │ │ ├── sunglasses.sfb │ │ │ └── yellow_sunglasses.sfb │ │ ├── java/ │ │ │ └── no/ │ │ │ └── realitylab/ │ │ │ └── arface/ │ │ │ ├── CustomFaceNode.kt │ │ │ ├── FaceArFragment.kt │ │ │ ├── FaceLandmarksActivity.kt │ │ │ ├── FaceRegionsActivity.kt │ │ │ ├── FilterFace.kt │ │ │ ├── GlassesActivity.kt │ │ │ ├── MainActivity.kt │ │ │ └── MakeupActivity.kt │ │ └── res/ │ │ ├── drawable/ │ │ │ ├── ic_autorenew_black_24dp.xml │ │ │ ├── ic_launcher_background.xml │ │ │ └── rounded_bg.xml │ │ ├── drawable-v24/ │ │ │ └── ic_launcher_foreground.xml │ │ ├── layout/ │ │ │ ├── activity_glasses.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_makeup.xml │ │ │ ├── activity_regions.xml │ │ │ ├── card_layout.xml │ │ │ └── element_layout.xml │ │ ├── mipmap-anydpi-v26/ │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ └── values/ │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test/ │ └── java/ │ └── no/ │ └── realitylab/ │ └── arface/ │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat └── settings.gradle
Condensed preview — 50 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (72K chars).
[
{
"path": ".gitignore",
"chars": 1009,
"preview": "# Built application files\n*.apk\n*.ap_\n\n# Files for the ART/Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated file"
},
{
"path": "LICENSE",
"chars": 1074,
"preview": "MIT License\n\nCopyright (c) 2019 Kristina Simakova\n\nPermission is hereby granted, free of charge, to any person obtaining"
},
{
"path": "README.md",
"chars": 664,
"preview": "# Augmented Faces ARCore tutorials\nAugmented Faces for Android\n\n<b> Try-On makeup with Augmented Faces </b> <br/>\nBlog p"
},
{
"path": "app/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "app/build.gradle",
"chars": 1595,
"preview": "apply plugin: 'com.android.application'\n\napply plugin: 'kotlin-android'\n\napply plugin: 'kotlin-android-extensions'\n\nandr"
},
{
"path": "app/gradle/wrapper/gradle-wrapper.properties",
"chars": 232,
"preview": "#Fri Dec 27 19:32:10 CET 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "app/gradle.properties",
"chars": 52,
"preview": "android.enableJetifier=true\nandroid.useAndroidX=true"
},
{
"path": "app/gradlew",
"chars": 5296,
"preview": "#!/usr/bin/env sh\n\n##############################################################################\n##\n## Gradle start up"
},
{
"path": "app/gradlew.bat",
"chars": 2260,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
},
{
"path": "app/proguard-rules.pro",
"chars": 751,
"preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
},
{
"path": "app/sampledata/sunglasses.sfa",
"chars": 1015,
"preview": "{\n animations: [\n {\n path: 'sampledata/sunglasses.fbx',\n },\n ],\n materials: [\n {\n name: '1A1A1A.00"
},
{
"path": "app/sampledata/yellow_sunglasses.sfa",
"chars": 1063,
"preview": "{\n animations: [\n {\n path: 'sampledata/yellow_sunglasses.fbx',\n },\n ],\n materials: [\n {\n name: 'bo"
},
{
"path": "app/src/androidTest/java/no/realitylab/arface/ExampleInstrumentedTest.kt",
"chars": 652,
"preview": "package no.realitylab.arface\n\nimport androidx.test.platform.app.InstrumentationRegistry\nimport androidx.test.ext.junit.r"
},
{
"path": "app/src/main/AndroidManifest.xml",
"chars": 2445,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xm"
},
{
"path": "app/src/main/java/no/realitylab/arface/CustomFaceNode.kt",
"chars": 4066,
"preview": "package no.realitylab.arface\n\nimport android.content.Context\nimport android.widget.ImageView\nimport com.google.ar.core.A"
},
{
"path": "app/src/main/java/no/realitylab/arface/FaceArFragment.kt",
"chars": 1043,
"preview": "package no.realitylab.arface\n\nimport android.os.Bundle\nimport android.view.LayoutInflater\nimport android.view.View\nimpor"
},
{
"path": "app/src/main/java/no/realitylab/arface/FaceLandmarksActivity.kt",
"chars": 3108,
"preview": "package no.realitylab.arface\n\nimport android.app.ActivityManager\nimport android.content.Context\nimport android.os.Bundle"
},
{
"path": "app/src/main/java/no/realitylab/arface/FaceRegionsActivity.kt",
"chars": 3495,
"preview": "package no.realitylab.arface\n\nimport android.app.ActivityManager\nimport android.content.Context\nimport android.os.Bundle"
},
{
"path": "app/src/main/java/no/realitylab/arface/FilterFace.kt",
"chars": 3046,
"preview": "package no.realitylab.arface\n\nimport android.content.Context\nimport android.os.Handler\nimport android.widget.TextView\nim"
},
{
"path": "app/src/main/java/no/realitylab/arface/GlassesActivity.kt",
"chars": 5053,
"preview": "package no.realitylab.arface\n\nimport android.app.ActivityManager\nimport android.content.Context\nimport android.net.Uri\ni"
},
{
"path": "app/src/main/java/no/realitylab/arface/MainActivity.kt",
"chars": 899,
"preview": "package no.realitylab.arface\n\nimport android.content.Intent\nimport androidx.appcompat.app.AppCompatActivity\nimport andro"
},
{
"path": "app/src/main/java/no/realitylab/arface/MakeupActivity.kt",
"chars": 3536,
"preview": "package no.realitylab.arface\n\nimport android.app.ActivityManager\nimport android.content.Context\nimport android.os.Bundle"
},
{
"path": "app/src/main/res/drawable/ic_autorenew_black_24dp.xml",
"chars": 540,
"preview": "<vector android:height=\"24dp\" android:tint=\"#D3D3D3\"\n android:viewportHeight=\"24.0\" android:viewportWidth=\"24.0\"\n "
},
{
"path": "app/src/main/res/drawable/ic_launcher_background.xml",
"chars": 4887,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n "
},
{
"path": "app/src/main/res/drawable/rounded_bg.xml",
"chars": 188,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <solid and"
},
{
"path": "app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
"chars": 1969,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:aapt=\"http://schemas.android.com/aapt\"\n"
},
{
"path": "app/src/main/res/layout/activity_glasses.xml",
"chars": 811,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/activity_main.xml",
"chars": 1110,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmln"
},
{
"path": "app/src/main/res/layout/activity_makeup.xml",
"chars": 493,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/activity_regions.xml",
"chars": 818,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns"
},
{
"path": "app/src/main/res/layout/card_layout.xml",
"chars": 687,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/layout/element_layout.xml",
"chars": 532,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n andr"
},
{
"path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
"chars": 270,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <b"
},
{
"path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
"chars": 270,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <b"
},
{
"path": "app/src/main/res/values/colors.xml",
"chars": 208,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"colorPrimary\">#008577</color>\n <color name=\"color"
},
{
"path": "app/src/main/res/values/strings.xml",
"chars": 341,
"preview": "<resources>\n <string name=\"app_name\">arface</string>\n <string name=\"makeup\">Makeup tutorial</string>\n <string n"
},
{
"path": "app/src/main/res/values/styles.xml",
"chars": 383,
"preview": "<resources>\n\n <!-- Base application theme. -->\n <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
},
{
"path": "app/src/test/java/no/realitylab/arface/ExampleUnitTest.kt",
"chars": 345,
"preview": "package no.realitylab.arface\n\nimport org.junit.Test\n\nimport org.junit.Assert.*\n\n/**\n * Example local unit test, which wi"
},
{
"path": "build.gradle",
"chars": 743,
"preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n e"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 233,
"preview": "#Sat Jul 06 09:14:13 CEST 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER"
},
{
"path": "gradle.properties",
"chars": 817,
"preview": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will ov"
},
{
"path": "gradlew",
"chars": 5296,
"preview": "#!/usr/bin/env sh\n\n##############################################################################\n##\n## Gradle start up"
},
{
"path": "gradlew.bat",
"chars": 2260,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
},
{
"path": "settings.gradle",
"chars": 15,
"preview": "include ':app'\n"
}
]
// ... and 6 more files (download for full content)
About this extraction
This page contains the full source code of the Kristina-Simakova/arfaces GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 50 files (64.0 KB), approximately 18.1k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.