Giter Site home page Giter Site logo

virtualglass-tryon's Introduction

Virtualglass tryon

Virtual try-on

This a small app that combines multiple python tutorial. This app probably doesn't scale very well, but it's simple enough. But it works well even on phone as long as you use firefox.

I used this tutorial to set up the video stream. One the server side we have a tornado app, that waits for an image to be received and then process the image and return back the location of the glass and a video stream.

For the server side javascript, I used this project. It's more or less the same app. The main differences is that in this one there is no server-side app. So estimating head pose with is actually not that great.

Finally, and most importantly, I used eos to get an accurate head pose estimator. This was the one that was the most accessible for a python user and It's fast enough to get let yoou process up to 20 images per second.

Regular install

Requirements:

Preferred method is to install everything from pip/anaconda

pip install -r requirements.txt

N.B. : For eos and dlib, you may need to install gcc-7 and g++-7. You will also need to install cmake.

CC=`which gcc-7` CXX=`which g++-7` pip install -r requirements.txt

Additional files:

You should create a directory files, and store inside it all the models used by the app:

mkdir files

The app also use dlib face detector download here ``

You will need additional files to get the head pose estimation with eos. You can get those files on the github of the project:

sfm_shape_3448.bin
expression_blendshapes_3448.bin
ibug_to_sfm.txt
sfm_3448_edge_topology.json
ibug_to_sfm.txt
sfm_model_contours.json

Usage

You need to edit the file index.htmland change the variable ws

To launch the app, just run with python 3

python application.py

Now, all you have to do is go to firefox http://localhost:8080, click on start to initiate the demo. There will be a 5 to 15 seconds latency in the beginning, before the glasses appear. You can click on synced to get your virtualglass synced with the image (there may be a small delay).

Installation on aws ubuntu

Install dependencies

sudo apt-get update
sudo apt-get -y upgrade gcc
sudo apt-get install -y g++-7 -y cmake -y libsm6 -y libxrender1 -y libfontconfig1

Install anaconda

wget https://repo.anaconda.com/archive/Anaconda3-5.3.0-Linux-x86_64.sh
bash Anaconda3-5.3.0-Linux-x86_64.sh

Activate the root environment

source /home/ubuntu/anaconda3/bin/activate root

Additional files

git clone https://github.com/patrikhuber/eos

git clone https://github.com/davisking/dlib-models
cd ~/dlib-models
bzip2 -dv ~/dlib-models/shape_predictor_68_face_landmarks.dat.bz2
cd ~

Install the project

git clone https://github.com/operman18/virtualglass-tryon
mkdir ~/virtualglass-tryon/files

ln -s ~/dlib-models/shape_predictor_68_face_landmarks.dat ~/virtualglass-tryon/files
ln -s ~/eos/share/* ~/virtualglass-tryon/files

cd virtualglass-tryon
CC=`which gcc-7` CXX=`which g++-7`  pip install -r requirements.txt

Final step

You should check if your machine is under a firewall, you will need to open port 8080.

Launch the project with

python application.py

virtualglass-tryon's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.