Last active
July 30, 2021 22:48
-
-
Save nhammad/1756f4e7c62485dd932bac69fb3d1f4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let capture: any = useRef<any>(); | |
let classifier: any = useRef<any>(); | |
//setting up the webcam from p5, and featureExtractor/classifier from ml5 | |
const setup = (p5: p5Types, canvasParentRef: Element) => { | |
capture.current = p5.createCapture(p5.VIDEO).parent(canvasParentRef); | |
const featureExtractor = ml5.featureExtractor("MobileNet", {epochs: props.numberOfEpochs}, modelReady); | |
classifier.current = featureExtractor.classification( | |
capture.current, | |
videoReady | |
); | |
}; | |
const draw = (p5: p5Types) => { | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment