0.3.1 • Published 6 months ago

vision-camera-plugin-scan-faces v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

vision-camera-plugin-scan-faces

VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector

Installation

yarn add vision-camera-plugin-scan-faces

Usage

Plugin initialization

//Configure VisionCamera
const PLUGIN_NAME = 'scanFaces';
const TARGET_FPS = 3;
const device = useCameraDevice('front');
const plugin = VisionCameraProxy.initFrameProcessorPlugin(PLUGIN_NAME);

const scanFaces = (frame: Frame): object => {
  'worklet';
  if (plugin == null) throw new Error(`Failed to load Frame Processor Plugin "${PLUGIN_NAME}"!`);
  const result = plugin.call(frame);
  console.log(result)
  if (result && typeof result === 'object') {
    return result;
  }
  throw new Error('Expected an object from the plugin call');
};

const frameProcessorScanFaces = useFrameProcessor((frame) => {
  'worklet';
  runAtTargetFps(TARGET_FPS, () => {
    'worklet';
    const faces = scanFaces(frame);
    console.log(`Faces in Frame: ${JSON.stringify(faces, null, 2)}`);
    //Work with faces here
  });
}, []);

Vision Camera

  <Camera
    enableBufferCompression={false}
    enableHighQualityPhotos={false}
    pixelFormat='yuv'
    hdr={false}
    device={device}
    photo
    video={false}
    frameProcessor={frameProcessorScanFaces}
    {...otherCameraProps}
  />

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

JSONStreamabababort-controllerabsolute-pathacceptsacornacorn-globalsacorn-jsxacorn-walkadd-streamagent-baseaggregate-errorajvanseransi-alignansi-colorsansi-escapesansi-fragmentsansi-regexansi-stylesanymatchappdirsjsargparsearr-diffarr-flattenarr-unionarray-filterarray-ifyarray-includesarray-maparray-reducearray-unionarray-uniquearray.prototype.flatmaparrifyasapassign-symbolsast-typesastral-regexasyncasync-limiterasync-retryasynckitat-least-nodeatobbabel-eslintbabel-plugin-dynamic-import-nodebabel-plugin-istanbulbabel-plugin-jest-hoistbabel-plugin-polyfill-corejs2babel-plugin-polyfill-corejs3babel-plugin-polyfill-regeneratorbabel-plugin-syntax-trailing-function-commasbalanced-matchbasebase64-jsbefore-after-hookbig-integerblboxenbplist-creatorbplist-parserbrace-expansionbracesbrowser-process-hrtimebrowserslistbserbufferbuffer-frombytescache-basecacheable-lookupcacheable-requestcall-bindcaller-callsitecaller-pathcallsitescamelcasecamelcase-keyscaniuse-litecapture-exitchalkchar-regexchardetci-infocjs-module-lexerclass-utilsclean-stackcli-boxescli-cursorcli-spinnerscli-widthcliuicloneclone-deepclone-responsecocollect-v8-coveragecollection-visitcolor-convertcolor-namecolorettecolorscombined-streamcommand-existscommandercommondircompare-funccompare-versionscomponent-emittercompressiblecompressionconcat-mapconcat-streamconfigstoreconnectconventional-changelogconventional-changelog-angularconventional-changelog-atomconventional-changelog-codemirrorconventional-changelog-conventionalcommitsconventional-changelog-coreconventional-changelog-emberconventional-changelog-eslintconventional-changelog-expressconventional-changelog-jqueryconventional-changelog-jshintconventional-changelog-preset-loaderconventional-changelog-writerconventional-commits-filterconventional-commits-parserconventional-recommended-bumpconvert-source-mapcopy-descriptorcore-jscore-js-compatcore-util-iscosmiconfigcross-spawncrypto-random-stringcssomcssstylecsstypedargsdata-urlsdateformatdayjsdebugdecamelizedecamelize-keysdecimal.jsdecode-uri-componentdecompress-responsededentdeep-extenddeep-isdeepmergedefaultsdefer-to-connectdefine-propertiesdefine-propertydeldelayed-streamdenodeifydepddeprecated-objdeprecationdestroydetect-newlinediff-sequencesdir-globdoctrinedomexceptiondot-propduplexer3ee-firstelectron-to-chromiumemitteryemoji-regexencodeurlend-of-streamenquirerenvinfoerror-exerror-stack-parsererrorhandleres-abstractes-to-primitiveescaladeescape-goatescape-htmlescape-string-regexpescodegeneslint-plugin-eslint-commentseslint-plugin-flowtypeeslint-plugin-jesteslint-plugin-reacteslint-plugin-react-hookseslint-plugin-react-nativeeslint-plugin-react-native-globalseslint-scopeeslint-utilseslint-visitor-keysespreeesprimaesqueryesrecurseestraverseesutilsetagevent-target-shimexec-shexecaexitexpand-bracketsexpectextend-shallowexternal-editorextglobfast-deep-equalfast-difffast-globfast-json-stable-stringifyfast-levenshteinfastqfb-watchmanfiguresfile-entry-cachefill-rangefilter-objfinalhandlerfind-cache-dirfind-upfind-versionsflatflat-cacheflattedflow-parserfor-inform-datafragment-cachefreshfs-extrafs.realpathfseventsfunction-bindfunctional-red-black-treegensyncget-caller-fileget-intrinsicget-package-typeget-pkg-repoget-stdinget-streamget-symbol-descriptionget-valuegit-raw-commitsgit-remote-origin-urlgit-semver-tagsgit-upgit-url-parsegitconfiglocalglobglob-parentglobal-dirsglobalsglobbygotgraceful-fsgrowlyhandlebarshard-rejectionhashas-bigintshas-flaghas-symbolshas-tostringtaghas-valuehas-valueshas-yarnhermes-enginehermes-profile-transformerhosted-git-infohtml-encoding-snifferhtml-escaperhttp-cache-semanticshttp-errorshttp-proxy-agenthttp2-wrapperhttps-proxy-agenthuman-signalsiconv-liteieee754ignoreimage-sizeimport-cwdimport-freshimport-fromimport-lazyimport-localimurmurhashindent-stringinflightinheritsiniinquirerinternal-slotinterpretinvariantipis-absoluteis-accessor-descriptoris-arrayishis-bigintis-boolean-objectis-bufferis-callableis-ciis-core-moduleis-data-descriptoris-date-objectis-descriptoris-directoryis-dockeris-extendableis-extglobis-fullwidth-code-pointis-generator-fnis-git-dirtyis-git-repositoryis-globis-installed-globallyis-interactiveis-negative-zerois-npmis-numberis-number-objectis-objis-path-cwdis-path-insideis-plain-objis-plain-objectis-potential-custom-element-nameis-regexis-relativeis-shared-array-bufferis-sshis-streamis-stringis-symbolis-text-pathis-typedarrayis-unc-pathis-unicode-supportedis-weakrefis-windowsis-wslis-yarn-globalisarrayisexeisobjectistanbul-lib-coverageistanbul-lib-instrumentistanbul-lib-reportistanbul-lib-source-mapsistanbul-reportsjest-changed-filesjest-clijest-configjest-diffjest-docblockjest-eachjest-environment-jsdomjest-environment-nodejest-get-typejest-haste-mapjest-jasmine2jest-leak-detectorjest-matcher-utilsjest-message-utiljest-mockjest-pnp-resolverjest-regex-utiljest-resolvejest-resolve-dependenciesjest-runnerjest-runtimejest-serializerjest-snapshotjest-utiljest-validatejest-watcherjest-workerjetifierjoijs-tokensjs-yamljsc-androidjscodeshiftjsdomjsescjson-bufferjson-parse-better-errorsjson-parse-even-better-errorsjson-schema-traversejson-stable-stringify-without-jsonifyjson-stringify-safejson5jsonfilejsonifyjsonparsejsx-ast-utilskeyvkind-ofklawkleurlatest-versionlevenlevnlines-and-columnsload-json-filelocate-pathlodashlodash.clonedeeplodash.debouncelodash.ismatchlodash.mergelodash.throttlelodash.truncatelog-symbolslogkittyloose-envifylowercase-keyslru-cachemacos-releasemake-dirmakeerrormap-cachemap-objmap-visitmeowmerge-streammerge2metrometro-babel-registermetro-babel-transformermetro-cachemetro-cache-keymetro-configmetro-coremetro-hermes-compilermetro-inspector-proxymetro-minify-uglifymetro-react-native-babel-transformermetro-resolvermetro-runtimemetro-source-mapmetro-symbolicatemetro-transform-pluginsmetro-transform-workermicromatchmimemime-dbmime-typesmimic-fnmimic-responsemin-indentminimatchminimistminimist-optionsmixin-deepmkdirpmodify-valuesmsmute-streamnanomatchnatural-comparenegotiatorneo-asyncnew-github-release-urlnice-trynocachenode-dirnode-fetchnode-int64node-modules-regexpnode-notifiernode-releasesnode-stream-zipnormalize-package-datanormalize-pathnormalize-urlnpm-run-pathnullthrowsnwsapiob1object-assignobject-copyobject-inspectobject-keysobject-visitobject.assignobject.entriesobject.fromentriesobject.hasownobject.pickobject.valueson-finishedon-headersonceonetimeopenopencollective-postinstalloptionatoroptionsoraos-nameos-tmpdirp-cancelablep-each-seriesp-finallyp-limitp-locatep-mapp-trypackage-jsonparent-moduleparse-jsonparse-pathparse-urlparse5parseurlpascalcasepath-existspath-is-absolutepath-keypath-parsepath-typepicocolorspicomatchpifypiratespkg-dirplease-upgrade-nodeplistposix-character-classesprelude-lsprepend-fileprepend-httpprettier-linter-helperspretty-formatprocess-nextick-argsprogresspromisepromptsprop-typesprotocolspslpumppunycodepupaqqsquery-stringqueue-microtaskquick-lrurange-parserrcreact-devtools-corereact-isreact-native-codegenreact-refreshread-pkgread-pkg-upreadable-streamrecastrechoirredentregenerateregenerate-unicode-propertiesregenerator-runtimeregenerator-transformregex-notregexp.prototype.flagsregexppregexpu-coreregistry-auth-tokenregistry-urlregjsgenregjsparserremove-trailing-separatorrepeat-elementrepeat-stringrequire-directoryrequire-from-stringrequire-main-filenameresolveresolve-alpnresolve-cwdresolve-fromresolve-globalresolve-urlresponselikerestore-cursorretretryreusifyrimrafrsvprun-asyncrun-parallelrxjssafe-buffersafe-regexsafer-buffersanesaxsaxesschedulersemversemver-comparesemver-diffsemver-regexsendserialize-errorserve-staticset-blockingset-valuesetprototypeofshallow-cloneshebang-commandshebang-regexshell-quoteshelljsshellwordsside-channelsignal-exitsimple-plistsisteransislashslice-ansisnapdragonsnapdragon-nodesnapdragon-utilsource-mapsource-map-resolvesource-map-supportsource-map-urlspdx-correctspdx-exceptionsspdx-expression-parsespdx-license-idssplitsplit-on-firstsplit-stringsplit2sprintf-jsstack-utilsstackframestacktrace-parserstatic-extendstatusesstream-buffersstrict-uri-encodestring-lengthstring-widthstring.prototype.matchallstring.prototype.trimendstring.prototype.trimstartstring_decoderstrip-ansistrip-bomstrip-eofstrip-final-newlinestrip-indentstrip-json-commentssudo-promptsupports-colorsupports-hyperlinkssymbol-treetabletemptemp-dirtemp-writeterminal-linktest-excludetext-extensionstext-tablethroatthroughthrough2tmptmplto-fast-propertiesto-object-pathto-readable-streamto-regexto-regex-rangetoidentifiertough-cookietr46trim-newlinestslibtsutilstype-checktype-detecttype-festtypedarraytypedarray-to-bufferuglify-esuglify-jsultronunbox-primitiveunc-path-regexunicode-canonical-property-names-ecmascriptunicode-match-property-ecmascriptunicode-match-property-value-ecmascriptunicode-property-aliases-ecmascriptunion-valueunique-stringuniversal-user-agentuniversalifyunpipeunset-valueupdate-browserslist-dbupdate-notifieruri-jsurixurl-joinurl-parse-laxuseuse-subscriptionutil-deprecateutils-mergeuuidv8-compile-cachev8-to-istanbulvalidate-npm-package-licensevaryvlqw3c-hr-timew3c-xmlserializerwalkerwcwidthwebidl-conversionswhatwg-encodingwhatwg-fetchwhatwg-mimetypewhatwg-urlwhichwhich-boxed-primitivewhich-modulewhich-pm-runswidest-linewindows-releaseword-wrapwordwrapwrap-ansiwrappywrite-file-atomicwsxcodexdg-basedirxml-name-validatorxmlbuilderxmlcharsxmldocxtendy18nyallistyamlyargsyargs-parseryocto-queue
0.3.1

6 months ago

0.2.5

7 months ago

0.2.4

7 months ago