• Stars
    star
    204
  • Rank 192,063 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

VideoView that plays video only when 👀 are open and 👦 is detected with various other features

LookAtMe

API Android Arsenal AwesomeAndroid Android Weekly Android Dev Digest Android Sweets Android-Tutorial-Online

VideoView that plays video only when 👀 are open and 👦 is detected with various other features

GIF

AndroidPub (Medium) Post

You can read the AndroidPub post about this library, the perks it provides and other details here.

Screenshots

screenshot_2019-01-10-07-02-17-959_com pd trackeye screenshot_2019-01-10-07-02-22-894_com pd trackeye

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
		repositories {
			...
			maven { url 'https://www.jitpack.io' }
		}
	}

Dependency

Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):

dependencies {
	        implementation 'com.github.Pradyuman7:LookAtMe:Version1.0'
}

For latest release, please check the JitPack version and match it with the dependency.

dependencies {
	        implementation 'com.github.Pradyuman7:LookAtMe:Version2.0'
}

Usage

LookAtMe is very easy to use and can be directly used in your application. You just need to first declare the LookAtMe variable in your activity, and add the following in layout of your activity (XML file).

        private LookAtMe lookAtMe;
        lookAtMe = findViewById(R.id.lookme);
	<com.pd.lookatme.LookAtMe
        	android:id="@+id/lookme"
        	android:layout_width="match_parent"
        	android:layout_height="250dp" />

After this, just initiallise LookAtMe variable with the activity context, add the video URI, start the video and just call setLookMe(), the whole code would look something like this:

        lookAtMe.init(this);
        lookAtMe.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.videoplayback));
	// lookAtMe.setVideoPath("http://website.com/video/mp4/62000/62792m.mp4"); to use video from a url
        
	lookAtMe.start();
        lookAtMe.setLookMe();

You can also personalise the experience according to your need, using init(). In this method you can add if you want the eye-tracking mode to be FAST or ACCURATE, and also which camera to use, front or back. The method bodies look like this:

	public void init(Context activityContext, String mode, String cameraFace){
        	// add mode to be fast or accurate and cameraFace to be front or back
    	}
	public void init(Context activityContext, String mode){
        	// add mode to be accurate or fast   
    	}

Version2.0 additions

Now in Version2.0 the developer can also access that if the user laughed / smiled during the video. For this, just use this initWithSmilingStatus() method instead of the normal init() like this:

	lookAtMe.initWithSmilingStatus(this); // for smiling status of the user

To access if the user smiled during the video after this, currently you have to acess the log of the app programatically. Currently, LookAtMe counts when user smiles and for how many frames. If the user smiles for 100 frames in total, LookAtMe logs a line stating that "the user smiled for 100 Frames!". After that count resets to 0.

You can access the log of your android app like this:

	try {
  		Process process = Runtime.getRuntime().exec("logcat");
  		BufferedReader bufferedReader = new BufferedReader(
  		new InputStreamReader(process.getInputStream()));

  		StringBuilder log = new StringBuilder();
  		String line = "";
  		while ((line = bufferedReader.readLine()) != null) {
	    		log.append(line);
  		}
  		TextView tv = (TextView)findViewById(R.id.textView1);
  		tv.setText(log.toString());
  	} 
	catch (IOException e) {}

To know more about this, please refer this link.

Pull Request

Have some new ideas or found a bug? Do not hesitate to open an issue and make a pull request.

License

LookAtME is under License: Apache. See the LICENSE file for more info.

Credits

The video being played in the android app is owned solely by Pixar animations and the author lays no claim over the video.

More Repositories

1

TrackEyes

A simple 👀 tracking and 👦 detection android app
Java
132
star
2

ChocoBar

The usual Snackbar with more 🍫 and colours 🎉
Java
124
star
3

Pager

🔥 An android library to get simple menu options on steroids 💪
Java
69
star
4

LetsChat

A personalised android 💯 chat application with your full control over it. 😄
Java
24
star
5

Colour-Learning

A simple machine learning webpage that understands & changes the text 🌈 according to the background.
JavaScript
21
star
6

Algorithmics

A Java library for people who want to implement some algorithms quickly.
Java
16
star
7

MachineLearning-Game

A simple machine learning ✊ ✋✌️ android game, which becomes unbeatable as you play!
Java
12
star
8

Pradyuman7.github.io

Learn about me in a Terminal-y way 😁
JavaScript
10
star
9

MovieBook

An android app that lets you search for movies and their cast, and helps you discover your taste of movies
Java
8
star
10

Toast-For-Java

A Java class that can be used for 🍞 like popup messages in simple Java applications.
Java
7
star
11

HackerRankEulerSolutions

My solutions to the ProjectEuler+ competition problems from HackerRank in C++, Java and Python.
Java
7
star
12

ChattingDemoApp

This is a demo app requested by people on stack overflow, to show how to create a real time chatting app using Firebase, with source code and info.
Java
6
star
13

AssemblyGames

These are the projects I made in x86-64/32/16 Assembly (Intel) during my Bachelor's course, Computer Organisation at TU Delft, just for fun.
Assembly
5
star
14

CommonFirebaseJSON

Compilation of the common security rules for Firebase that are often used by people in their projects.
5
star
15

Theme-Recommender

Theme recommendation system using machine learning
JavaScript
3
star
16

SnakeGame

A snake game made purely in assembly x86_32, using VT100 characters for graphics of snake.
Assembly
2
star
17

HackerRankSolutions

My Solutions to some of the HackerRank practice problems in Java and C++ (Python , C#)
Java
2
star
18

ImportantAlgorithms

This is the collection of those Algorithms that you may need to know to get faster in solving Programming questions.
Java
2
star
19

SimpleNeuralNetwork

A simple neural network for XOR decryption and more
Java
2
star
20

JavaAppletSnake

The classical and simple snake game in Java that can be executed as Java Applet.
Java
2
star
21

Developer-Record

My records as a developer (only major projects).
JavaScript
1
star
22

TextReader

A simple code to make an android TextReader, which reads the text typed, aloud, for android beginners.
Java
1
star
23

awesome-anime

Awesome anime frontend (made using Pusher API)
HTML
1
star
24

New-Sogeti

New website for Sogeti made between 1 am to 3 am in HackDelft 2019
CSS
1
star
25

SimplePlatformerGame

Simple platformer game made with JavaScript and lots of caffeine, as this was made at 3 AM, with drowsy eyes and inquisitive mind.
JavaScript
1
star
26

LinearSystemSolver

Linear equation system solver in Java
Java
1
star
27

Projects-Showcase

Collection of projects I have worked on, excluding too old, in a creative webpage.
CSS
1
star
28

Tree

Tree data structure class in all of its glory, in Java.
Java
1
star
29

Tower-Of-Hanoi

This is a simple Tower of Hanoi (game, if you call it) using C++. If recursion is what you want to brush up, then this is your playground.
C++
1
star
30

Rosalind-Problem-Solutions

My solutions to problems from Rosalind.info to understand algorithmic problems in real life bioinformatics.
Java
1
star