Skip to content

Commit

Permalink
feat(face-centering) implement centering of faces in a video
Browse files Browse the repository at this point in the history
Config options:

faceCoordinatesSharing.enabled
faceCoordinatesSharig.threshold
faceCoordinatesSharing.captureInterval
  • Loading branch information
quitrk authored and hristoterezov committed Mar 5, 2022
1 parent 2863b05 commit d718d9d
Show file tree
Hide file tree
Showing 21 changed files with 800 additions and 14 deletions.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ DEPLOY_DIR = libs
LIBJITSIMEET_DIR = node_modules/lib-jitsi-meet
LIBFLAC_DIR = node_modules/libflacjs/dist/min
OLM_DIR = node_modules/@matrix-org/olm
TF_WASM_DIR = node_modules/@tensorflow/tfjs-backend-wasm/dist/
RNNOISE_WASM_DIR = node_modules/rnnoise-wasm/dist
TFLITE_WASM = react/features/stream-effects/virtual-background/vendor/tflite
MEET_MODELS_DIR = react/features/stream-effects/virtual-background/vendor/models
Expand All @@ -29,7 +30,7 @@ clean:
rm -fr $(BUILD_DIR)

.NOTPARALLEL:
deploy: deploy-init deploy-appbundle deploy-rnnoise-binary deploy-tflite deploy-meet-models deploy-lib-jitsi-meet deploy-libflac deploy-olm deploy-css deploy-local deploy-facial-expressions
deploy: deploy-init deploy-appbundle deploy-rnnoise-binary deploy-tflite deploy-meet-models deploy-lib-jitsi-meet deploy-libflac deploy-olm deploy-tf-wasm deploy-css deploy-local deploy-facial-expressions

deploy-init:
rm -fr $(DEPLOY_DIR)
Expand All @@ -52,6 +53,8 @@ deploy-appbundle:
$(OUTPUT_DIR)/analytics-ga.js \
$(BUILD_DIR)/analytics-ga.min.js \
$(BUILD_DIR)/analytics-ga.min.js.map \
$(BUILD_DIR)/face-centering-worker.min.js \
$(BUILD_DIR)/face-centering-worker.min.js.map \
$(BUILD_DIR)/facial-expressions-worker.min.js \
$(BUILD_DIR)/facial-expressions-worker.min.js.map \
$(DEPLOY_DIR)
Expand Down Expand Up @@ -80,6 +83,11 @@ deploy-olm:
$(OLM_DIR)/olm.wasm \
$(DEPLOY_DIR)

deploy-tf-wasm:
cp \
$(TF_WASM_DIR)/*.wasm \
$(DEPLOY_DIR)

deploy-rnnoise-binary:
cp \
$(RNNOISE_WASM_DIR)/rnnoise.wasm \
Expand Down Expand Up @@ -109,7 +117,7 @@ deploy-local:
([ ! -x deploy-local.sh ] || ./deploy-local.sh)

.NOTPARALLEL:
dev: deploy-init deploy-css deploy-rnnoise-binary deploy-tflite deploy-meet-models deploy-lib-jitsi-meet deploy-libflac deploy-olm deploy-facial-expressions
dev: deploy-init deploy-css deploy-rnnoise-binary deploy-tflite deploy-meet-models deploy-lib-jitsi-meet deploy-libflac deploy-olm deploy-tf-wasm deploy-facial-expressions
$(WEBPACK_DEV_SERVER)

source-package:
Expand Down
12 changes: 12 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/* eslint-disable no-unused-vars, no-var */

var config = {
Expand Down Expand Up @@ -749,6 +750,17 @@ var config = {
// Enables displaying facial expressions in speaker stats
// enableDisplayFacialExpressions: true,

// faceCoordinatesSharing: {
// // Enables sharing your face cordinates. Used for centering faces within a video.
// enabled: false,

// // Minimum required face movement percentage threshold for sending new face coordinates data.
// threshold: 10,

// // Miliseconds for processing a new image capture in order to detect face coordinates if they exist.
// captureInterval: 100
// },

// Controls the percentage of automatic feedback shown to participants when callstats is enabled.
// The default value is 100%. If set to 0, no automatic feedback will be requested
// feedbackPercentage: 100,
Expand Down
1 change: 1 addition & 0 deletions css/_aui_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ canvas,
progress,
video {
display: inline-block;
transition: object-position 0.5s ease 0s;
vertical-align: baseline;
}
audio:not([controls]) {
Expand Down
1 change: 0 additions & 1 deletion css/filmstrip/_tile_view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* CSS styles that are specific to the filmstrip that shows the thumbnail tiles.
*/
.tile-view {

.remote-videos {
align-items: center;
box-sizing: border-box;
Expand Down
177 changes: 177 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
"@react-navigation/native": "6.0.6",
"@react-navigation/stack": "6.0.11",
"@svgr/webpack": "4.3.2",
"@tensorflow-models/blazeface": "0.0.7",
"@tensorflow/tfjs-backend-wasm": "3.13.0",
"@tensorflow/tfjs-converter": "3.13.0",
"@tensorflow/tfjs-core": "3.13.0",
"@vladmandic/face-api": "1.6.4",
"@xmldom/xmldom": "0.7.5",
"amplitude-js": "8.2.1",
Expand Down
Loading

0 comments on commit d718d9d

Please sign in to comment.