yihong1120 / YOLOv8-License-Plate-Insights

This repository demonstrates YOLOv8-based license plate recognition with GCP Vision AI integration, enabling versatile real-world applications like vehicle identification, traffic monitoring, and geospatial analysis while capturing vital media metadata for enhanced insights.
MIT License
5 stars 2 forks source link

issue with google cloud vision integration #1

Open sushantsapra opened 12 months ago

sushantsapra commented 12 months ago

hello sir thanks a lot for uploading your work

I am getting the following error with respect to integration and credentials of google cloud vision client

{'Error': 'No EXIF data found in the image.'}

0: 480x640 1 license, 72.8ms Speed: 5.3ms preprocess, 72.8ms inference, 3.0ms postprocess per image at shape (1, 3, 480, 640) Traceback (most recent call last): File "/home/sushant/YOLOv8-License-Plate-Detection/inference.py", line 334, in recognized_img = detector.recognize_license_plate(file_path) File "/home/sushant/YOLOv8-License-Plate-Detection/inference.py", line 54, in recognize_license_plate license_plate = self.extract_license_plate_text(roi) File "/home/sushant/YOLOv8-License-Plate-Detection/inference.py", line 119, in extract_license_plate_text client = vision.ImageAnnotatorClient() File "/home/sushant/anaconda321/envs/banodet/lib/python3.10/site-packages/google/cloud/vision_v1/services/image_annotator/client.py", line 462, in init self._transport = Transport( File "/home/sushant/anaconda321/envs/banodet/lib/python3.10/site-packages/google/cloud/vision_v1/services/image_annotator/transports/grpc.py", line 155, in init super().init( File "/home/sushant/anaconda321/envs/banodet/lib/python3.10/site-packages/google/cloud/vision_v1/services/imageannotator/transports/base.py", line 103, in init credentials, = google.auth.default( File "/home/sushant/anaconda321/envs/banodet/lib/python3.10/site-packages/google/auth/_default.py", line 691, in default raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS) google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.

yihong1120 commented 12 months ago

Hey there!

Thanks for reaching out. Looks like you've hit a couple of snags with the Google Cloud Vision API. Let's untangle this, shall we?

  1. Missing EXIF Data:

    • This error usually pops up when your image file is missing EXIF data. That's the stuff like camera settings, timestamps, etc., embedded in the picture. Just double-check your images to make sure they've got this data.
  2. Default Credentials Not Found:

    • This one's about the API client not finding the creds it needs to kick things off. Here’s a quick guide to fix it:
      • Make sure you've got a project set up in Google Cloud Console with the Vision API turned on.
      • Create a service account and download its key (a JSON file).
      • Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to your key file.
    • You can find more detailed instructions in the Google Cloud docs. They’re pretty handy.

By the way, we're planning to add a tutorial on setting up the Google Cloud Vision API soon. Keep an eye out for that – it should help you get things running smoothly.

Cheers!