Face-Detection-JavaScript
Face-Detection-JavaScript copied to clipboard
how to save photo of detected face?
how can I get the detected faces in photos. example: I would like to save faces that were detected in the video
thanks
Not exactly this but somewhere along these lines of code. This is an old project where I uploaded the image to a site and the site then detected faces from the picture it was given.
`onButtonSubmit = () => {
this.setState({imageUrl: this.state.input});
fetch('http://localhost:3000/imageurl', {
method: 'post',
headers: {
'Content-Type': 'application/json',
'Authorization': window.sessionStorage.getItem('token')
},
body: JSON.stringify({
input: this.state.input
})
})
.then(response => response.json())
.then(response => {
if (response) {
fetch('http://localhost:3000/image', {
method: 'put',
headers: {
'Content-Type': 'application/json',
'Authorization': window.sessionStorage.getItem('token')
},
body: JSON.stringify({
id: this.state.user.id
})
})
.then(response => response.json())
.then(count => {
this.setState(Object.assign(this.state.user, { entries: count}))
})
.catch(console.log)
}
console.log(response)
this.displayFaceBoxes(this.calculateFaceLocations(response))
})
.catch(err => console.log(err));
}`