Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@iad-os/emotion-detector

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iad-os/emotion-detector

EmotionDetector makes use of face-api to detect emotions, genders, age.

  • 1.0.19
  • latest
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Introduction

EmotionDetector is a fully configurable React library that makes use of face-api.js to detect:

  • emotions
  • gender
  • age

Getting Started

Dependencies

The library has been successfully tested with the following packages versions. If you have a more recent version of these packages feel free to experiment and give me a feedback.

"react": "16.14.0",
"react-dom": "16.14.0",
"react-scripts": "3.4.3",
"web-vitals": "2.1.4"

Install

npm install @iad-os/emotion-detector

During the installation process you will notice that some required files will be copied under your "public" dir.

Usage Example

Minimal code to use the component:

<EmotionDetector
    onEmotionDetect={(detection: Detection) => {
    	//... some stuff with Detection object
    }}
    detecting={true}
 />

You can also use various props to fully configure the component.

Available props

Required Props

KeyTypeDescriptionDefault
detectingbooleanEnable/Disable Detection

Additional Props

KeyTypeDescriptionDefault
onEmotionDetectFunctionCalled on each detection. Returns a Detection object.
emotionDetectPeriodnumberSpecifies the period between onEmotionDetect calls1000
detectionPeriodMillisnumberSet detection period of face-api in milliseconds. Should be <= emotionDetectPeriod1000
emoThresholdnumberSet a minimum percentage to say a emotion is for sure the one detected. Ex: if "happy" percentage is < emoThreshold, say it's positive.60
detectAgebooleanEnable/Disable Age detectiontrue
detectSexbooleanEnable/Disable Sex Detectiontrue
showCambooleanShow/Hide Cam Componenttrue
camSizeRationumberSize ratio of the cam component. "1" is the Max Cam Size Resolution.1
showLabelbooleanShow/Hide Label componenttrue
enableAnimationsbooleanEnable/Disable Animationstrue
labelFormatstringDetection label format. Available values: "text", "emoji", "both". The Default value depend on the camSizeRatio and on the cam size."both"
textstringCustom label text
labelStyleReact.CSSPropertiesCustom label style

Keywords

FAQs

Package last updated on 19 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc