Skip to content

how to save photo of detected face? #21

Description

@amurad90

how can I get the detected faces in photos.
example:
I would like to save faces that were detected in the video

thanks

Activity

  1. jcrommar commented on Feb 17, 2020

    @jcrommar

    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));
      }`
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions