Skip to content

Commit

Permalink
ref(face-landmarks) refactor namings (jitsi#11307)
Browse files Browse the repository at this point in the history
* ref(face-landmarks) refactor namings

* code review
  • Loading branch information
quitrk authored Apr 6, 2022
1 parent a99532b commit 42703fe
Show file tree
Hide file tree
Showing 37 changed files with 286 additions and 291 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ libs/*
resources/*
react/features/stream-effects/virtual-background/vendor/*
load-test/*
react/features/facial-recognition/resources/*
react/features/face-landmarks/resources/*

# ESLint will by default ignore its own configuration file. However, there does
# not seem to be a reason why we will want to risk being inconsistent with our
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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
FACIAL_MODELS_DIR = react/features/facial-recognition/resources
FACE_MODELS_DIR = react/features/face-landmarks/resources
NODE_SASS = ./node_modules/.bin/sass
NPM = npm
OUTPUT_DIR = .
Expand All @@ -30,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-tf-wasm 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-face-landmarks

deploy-init:
rm -fr $(DEPLOY_DIR)
Expand All @@ -53,8 +53,8 @@ deploy-appbundle:
$(OUTPUT_DIR)/analytics-ga.js \
$(BUILD_DIR)/analytics-ga.min.js \
$(BUILD_DIR)/analytics-ga.min.js.map \
$(BUILD_DIR)/facial-expressions-worker.min.js \
$(BUILD_DIR)/facial-expressions-worker.min.js.map \
$(BUILD_DIR)/face-landmarks-worker.min.js \
$(BUILD_DIR)/face-landmarks-worker.min.js.map \
$(DEPLOY_DIR)
cp \
$(BUILD_DIR)/close3.min.js \
Expand Down Expand Up @@ -101,9 +101,9 @@ deploy-meet-models:
$(MEET_MODELS_DIR)/*.tflite \
$(DEPLOY_DIR)

deploy-facial-expressions:
deploy-face-landmarks:
cp \
$(FACIAL_MODELS_DIR)/* \
$(FACE_MODELS_DIR)/* \
$(DEPLOY_DIR)

deploy-css:
Expand All @@ -115,7 +115,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-tf-wasm 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-face-landmarks
$(WEBPACK_DEV_SERVER)

source-package:
Expand Down
9 changes: 0 additions & 9 deletions conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -3116,15 +3116,6 @@ export default {
room.sendEndpointMessage(to, payload);
},

/**
* Sends a facial expression as a string and its duration as a number
* @param {object} payload - Object containing the {string} facialExpression
* and {number} duration
*/
sendFacialExpression(payload) {
room.sendFacialExpression(payload);
},

/**
* Adds new listener.
* @param {String} eventName the name of the event
Expand Down
18 changes: 9 additions & 9 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,18 +752,18 @@ var config = {
// Enables sending participants' emails (if available) to callstats and other analytics
// enableEmailInStats: false,

// Enables detecting faces of participants and get their expression and send it to other participants
// enableFacialRecognition: true,
// faceLandmarks: {
// // Enables sharing your face cordinates. Used for centering faces within a video.
// enableFaceCentering: false,

// Enables displaying facial expressions in speaker stats
// enableDisplayFacialExpressions: true,
// // Enables detecting face expressions and sharing data with other participants
// enableFaceExpressionsDetection: false,

// faceCoordinatesSharing: {
// // Enables sharing your face cordinates. Used for centering faces within a video.
// enabled: false,
// // Enables displaying face expressions in speaker stats
// enableDisplayFaceExpressions: false,

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

// // Miliseconds for processing a new image capture in order to detect face coordinates if they exist.
// captureInterval: 100
Expand Down
2 changes: 1 addition & 1 deletion react/features/app/middlewares.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import '../shared-video/middleware';
import '../settings/middleware';
import '../talk-while-muted/middleware';
import '../virtual-background/middleware';
import '../facial-recognition/middleware';
import '../face-landmarks/middleware';
import '../gifs/middleware';

import './middlewares.any';
2 changes: 1 addition & 1 deletion react/features/app/reducers.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import '../base/devices/reducer';
import '../e2ee/reducer';
import '../facial-recognition/reducer';
import '../face-landmarks/reducer';
import '../feedback/reducer';
import '../local-recording/reducer';
import '../no-audio-signal/reducer';
Expand Down
3 changes: 1 addition & 2 deletions react/features/base/config/configWhitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ export default [
'enableDisplayNameInStats',
'enableEmailInStats',
'enableEncodedTransformSupport',
'enableFacialRecognition',
'enableIceRestart',
'enableInsecureRoomNameWarning',
'enableLayerSuspension',
Expand All @@ -152,7 +151,7 @@ export default [
'enableTcc',
'enableAutomaticUrlCopy',
'etherpad_base',
'faceCoordinatesSharing',
'faceLandmarks',
'failICE',
'feedbackPercentage',
'fileRecordingsEnabled',
Expand Down
60 changes: 60 additions & 0 deletions react/features/face-landmarks/actionTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// @flow

/**
* Redux action type dispatched in order to add a face expression.
*
* {
* type: ADD_FACE_EXPRESSION,
* faceExpression: string,
* duration: number
* }
*/
export const ADD_FACE_EXPRESSION = 'ADD_FACE_EXPRESSION';

/**
* Redux action type dispatched in order to add a expression to the face expressions buffer.
*
* {
* type: ADD_TO_FACE_EXPRESSIONS_BUFFER,
* faceExpression: string
* }
*/
export const ADD_TO_FACE_EXPRESSIONS_BUFFER = 'ADD_TO_FACE_EXPRESSIONS_BUFFER ';

/**
* Redux action type dispatched in order to clear the face expressions buffer in the state.
*
* {
* type: CLEAR_FACE_EXPRESSIONS_BUFFER
* }
*/
export const CLEAR_FACE_EXPRESSIONS_BUFFER = 'CLEAR_FACE_EXPRESSIONS_BUFFER';

/**
* Redux action type dispatched in order to set recognition active in the state.
*
* {
* type: START_FACE_LANDMARKS_DETECTION
* }
*/
export const START_FACE_LANDMARKS_DETECTION = 'START_FACE_LANDMARKS_DETECTION';

/**
* Redux action type dispatched in order to set recognition inactive in the state.
*
* {
* type: STOP_FACE_LANDMARKS_DETECTION
* }
*/
export const STOP_FACE_LANDMARKS_DETECTION = 'STOP_FACE_LANDMARKS_DETECTION';

/**
* Redux action type dispatched in order to update coordinates of a detected face.
*
* {
* type: UPDATE_FACE_COORDINATES,
* faceBox: Object({ left, bottom, right, top }),
* participantId: string
* }
*/
export const UPDATE_FACE_COORDINATES = 'UPDATE_FACE_COORDINATES';
Loading

0 comments on commit 42703fe

Please sign in to comment.