question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Face Detection Tutorial Issues

See original GitHub issue

There are a few problems with the cloud vision face tutorial:

Setup

  • canvas in optionalDependencies: This is a required dependency.
  • “Put it all together”: This section does not have any description and does not have copy-pasteable code I would expect in an “All together” section.
  • node faceDetection face.png:

Running

After the setup, run: node faceDetection face.png

You’ll get the error:

ERROR: { Error: ENOENT: no such file or directory, open 'face.png' errno: -2, code: 'ENOENT', syscall: 'open', path: 'face.png' }
{ Error: ENOENT: no such file or directory, open 'face.png' errno: -2, code: 'ENOENT', syscall: 'open', path: 'face.png' }
^C

What you really need is: node faceDetection.js resources/face.png

ERROR: { Error: 7 PERMISSION_DENIED: Cloud Vision API has not been used in project cloud-devshell-dev before or it is disabled. Enable it by visiting https://console.developers.googl
e.com/apis/api/vision.googleapis.com/overview?project=cloud-devshell-dev then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems a
nd retry.

Fixing permissions

I tried to enable the Vision API in the Cloud Shell, first trying to find the API:

gcloud services list

ERROR: (gcloud.services.list) PERMISSION_DENIED: Not allowed to get project settings for project cloud-devshell-dev

I’m not sure if I could enable the API without knowing the id. Maybe I needed to create a new project rather than cloud-devshell-dev.

Guessing at the API id:

gcloud services enable vision.googleapis

User does not have permission to access service [vision.googleapis:enable] (or it may not exist): The caller does not have permission.

At this point I gave up. It would be ideal if you could just “Open in Cloud Shell”, npm i, and npm run detect.

I first found this tutorial on GitHub. The process of switching between cloud.google.com, GitHub tutorial README, GitHub main README, and Cloud Shell is very confusing.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
JustinBeckwithcommented, Sep 22, 2018

Thanks @grant! Handling this over to the @googleapis/ml-apis folks to take a look at 😃

0reactions
grantcommented, Jun 14, 2019

@dizcology Looks pretty good, but we still need a description for “Put it all together”. https://cloud.google.com/vision/docs/face-tutorial#put_it_all_together

We can’t just have unexplained code snippets.

Something like… To call our Vision API, create a main method which will...

Please re-open until that feedback is incorporated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Perform Face Detection with Deep Learning
In this tutorial, you will discover how to perform face detection in Python using classical and deep learning models.
Read more >
TinyYoloV2 Face Detection: Tutorial
The face detector in this demonstration is a deep convolutional neural network. It's "deep" because it has many layers. It's "convolutional" because it ......
Read more >
Real-Time Face Recognition: An End-To-End Project
On my tutorial exploring OpenCV, we learned AUTOMATIC VISION OBJECT TRACKING. Now we will use our PiCam to recognize faces in real-time, as...
Read more >
Face Recognition with Python, in Under 25 Lines of Code
In this tutorial, we'll show an example of using Python and OpenCV to perform face recognition.
Read more >
Face Recognition with Python and OpenCV
Face detection can be thought of as such a problem where we detect human faces in an image. There may be slight differences...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found