Coder Social home page Coder Social logo

faciop-cojt / faciop-face-detection-sandbox Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 2.37 MB

顔検知やARレンダリングに関する実験プロジェクト

Home Page: https://faciop-cojt.github.io/faciop-face-detection-sandbox/

Vue 8.85% JavaScript 1.92% TypeScript 89.23%
vue nuxt facemesh typescript tensorflow threejs facetracking

faciop-face-detection-sandbox's Introduction

faciop facial sandbox

About

COJTのプロジェクトの一つ。facemeshとthree.jsを使って簡易的なARフィルターを作るための実験用プロジェクト。

Environment

Install & Usage

Contact

なにかございましたらこちらのTwitterアカウントにご連絡いただけると幸いです。

faciop-face-detection-sandbox's People

Contributors

dependabot[bot] avatar drumath2237 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

faciop-face-detection-sandbox's Issues

READMEの整備

このプロジェクトが何をするためのものなのかを明確にする

帽子、マスクなどへの対応

いまは眼鏡に対して特定のポリゴンのtransformをもたせているが、
他のファッションアイテムのカテゴリに対してもちゃんと適用できるように抽象化する。

ファッションアイテム用のオブジェクト型を定義してそれに対して操作するのがいいかも

外部のURLから3Dデータを取得してロード

外部URLからglTFのバイナリをDLしてthree.jsのシーンに配置する
urlは適当にgithubとかの使ってもいいかなって思ってる。
理想的にはfiresotreみたいなBlobストレージから落としてくること。

3Dオブジェクトを顔のメッシュに追従させる

facemeshで取得したメッシュに対して、顔のファッションアイテムを配置して、
facemeshの姿勢に合わせて3Dオブジェクトを追従させる

  • glTFモデルのインポート
  • glTFモデルの配置
  • 動きに合わせてファッションアイテムを追従させる

顔の位置・回転を計算する

facemeshによって読み込んだ顔のメッシュから、顔の姿勢を推定する。

  • 顔の回転を推定する
  • スケールされていない座標系によって、顔の位置を取得する

facemeshを使用して顔のと特徴点の取得

facemeshをtypescriptで読み込んで、顔の特徴点を取得する

  • facemeshパッケージのインポート
  • facemeshにビデオストリームを食わせる
  • videoを表示する
  • three.jsにレンダリングする

three.jsでcanvasに簡単なシーンをレンダリングする

three.jsのレンダリングをnuxt.js上で実行する
cubeとPlaneだけでもいいので適当なシーンをレンダリングしたものを出す。

  • テストページを作る
  • default.vue上にcanvasを作っておく
  • canvas用のcomponentの定義
  • canvas上にレンダリング
  • domとthree.jsの連携

FaceMeshFaceGeometry

facemeshで顔のジオメトリを形成するリポジトリがあったのでそこからコードを拝借、実装を試みる

カメラのサイズが4:3じゃないと正常に動作しない

videoサイズを決め打ちでやっているので、デフォルトで自分の環境に合わせて4:3を指定している
やっぱり16:9とかだと動かないっぽい

getUserMediaの時点でカメラのサイズをこちらから指定せずに取得する方法があればよいのだが…

カメラの切り替え機能

バーチャルカメラとかがあるとすごいめんどくさいので、getUserMediaで使用するカメラを切り替えられる機能を付ける

なんとなく、domとロジックの連携がめんどくさそうなので、一回設計を見直してからやる必要があるかもしれない

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.