Giter Club home page Giter Club logo

virtual-glasses-try-on's Introduction

Virtual Glasses Try on

Implementation of virtual glasses using Three.js + TensorFlow.js + Facemesh model.

Experience the cutting-edge fusion of computer vision and augmented reality

Allowing users to try on various 3D glasses in real-time.

Live Demo

https://bensonruan.com/virtual-try-on-glasses-with-javascript/

virtual-glasses-try-on

Installing

Clone this repository to your local computer

git https://github.com/bensonruan/Virtual-Glasses.git

Install three.js

npm install --save three

Point your localhost to the cloned root directory

Browse to http://localhost/index.html

Face Keypoints

The facemesh detected keypoints that used for overlay the 3D Glasses:

  • Middle between Eyes : 168
  • Left Eye : 143
  • Bottom of Nose : 2
  • Right Eye : 372

face-landmarks

Try glasses on

  • Click "Try it On" to turn on the Webcam switch, and allowing the browser to access your webcam
  • Wait for a few seconds to Load Model for face landmark detection
  • Choose the 3d glasses you would like to try on, watch yourself in fashion

Notes

  • Please note that on IOS Safari, cameras can only be accessed via the https protocol
  • Facemesh model is designed for front-facing cameras on mobile devices, where faces in view tend to occupy a relatively large fraction of the canvas. MediaPipe Facemesh may struggle to identify far-away faces.

Library

  • jquery - JQuery
  • three.js - JavaScript 3D Library
  • webcam-easy.js - javascript library for accessing webcam stream and taking photos
  • facemesh - MediaPipe Facemesh is a lightweight machine learning pipeline predicting 486 3D facial landmarks to infer the approximate surface geometry of a human face

Credit 3D glasses models

Support me

ko-fi

virtual-glasses-try-on's People

Contributors

bensonruan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

virtual-glasses-try-on's Issues

can not run the project, need help

Hi Ben,

I think your project is great however I can not get it running on my localhost, can you provide more info on how to run it locally pls?

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.