Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@dannadori/facemesh-worker-js
Advanced tools
Readme
This is webworker module for Face landmarks detection.
$ npm install \@dannadori/facemesh-worker-js
$ cp node_modules/\@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm.wasm public/
generateFacemeshDefaultConfig: () => FacemeshConfig;
generateDefaultFacemeshParams: () => FacemeshOperationParams;
drawFacemeshImage: (srcCanvas: HTMLCanvasElement, prediction: facemesh.AnnotatedPrediction[], params: FacemeshOperationParams) => ImageData;
FacemeshWorkerManager
init: (config: FacemeshConfig | null) => Promise<unknown>;
predict: (targetCanvas: HTMLCanvasElement, params: FacemeshOperationParams) => Promise<any>;
export interface ModelConfig{
maxContinuousChecks: number;
detectionConfidence: number;
maxFaces: number;
iouThreshold: number;
scoreThreshold: number;
}
export interface FacemeshConfig {
browserType : BrowserType
useTFWasmBackend : boolean
wasmPath : string
modelReloadInterval : number
model : ModelConfig
processOnLocal : boolean
}
export interface FacemeshOperationParams {
type: FacemeshFunctionType;
processWidth: number;
processHeight: number;
predictIrises: boolean;
}
export enum FacemeshFunctionType{
DetectMesh,
}
$ npx create-react-app demo --template typescript
$ cd demo/
$ npm install
$ npm install @dannadori/facemesh-worker-js
$ cp node_modules/\@tensorflow/tfjs-backend-wasm/dist/tfjs-backend-wasm.wasm public/
In this time, the name is "srcImage.jpg"
Sample code is here.
import React from 'react';
import './App.css';
import { FacemeshWorkerManager, generateDefaultFacemeshParams, generateFacemeshDefaultConfig, drawFacemeshImage } from '@dannadori/facemesh-worker-js'
class App extends React.Component{
manager = new FacemeshWorkerManager()
config = generateFacemeshDefaultConfig()
params = generateDefaultFacemeshParams()
srcCanvas = document.createElement("canvas")
dstCanvas = document.createElement("canvas")
componentDidMount = () =>{
document.getRootNode().lastChild!.appendChild(this.srcCanvas)
document.getRootNode().lastChild!.appendChild(this.dstCanvas)
const srcImage = document.createElement("img")
srcImage.onload = () =>{
this.manager.init(this.config).then(()=>{
this.srcCanvas.getContext("2d")!.drawImage(
srcImage, 0, 0, this.srcCanvas.width, this.dstCanvas.height)
return this.manager.predict(this.srcCanvas, this.params)
}).then((res)=>{
console.log(res)
const facemeshImage = drawFacemeshImage(this.srcCanvas, res, this.params)
this.dstCanvas.getContext("2d")!.putImageData(facemeshImage, 0, 0)
})
}
srcImage.src = "./srcImage.jpg"
}
render = ()=>{
return (
<div className="App">
</div>
);
}
}
export default App;
$ npm run start
FAQs
This is webworker module for [Face landmarks detection](https://github.com/tensorflow/tfjs-models/tree/master/face-landmarks-detection).
The npm package @dannadori/facemesh-worker-js receives a total of 2 weekly downloads. As such, @dannadori/facemesh-worker-js popularity was classified as not popular.
We found that @dannadori/facemesh-worker-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.