Skip to content

Instantly share code, notes, and snippets.

View mayankchourasia's full-sized avatar

Mayank Chourasia mayankchourasia

  • Pune
View GitHub Profile
@mayankchourasia
mayankchourasia / analyze-image.py
Created May 17, 2021 10:05
Integrate with Machine Learning APIs: Challenge Lab
# Dataset: image_classification_dataset
# Table name: image_text_detail
import os
import sys
# Import Google Cloud Library modules
from google.cloud import storage, bigquery, language, vision, translate_v2
if ('GOOGLE_APPLICATION_CREDENTIALS' in os.environ):
if (not os.path.exists(os.environ['GOOGLE_APPLICATION_CREDENTIALS'])):
print ("The GOOGLE_APPLICATION_CREDENTIALS file does not exist.\n")
exit()
runtime: php72
env_variables:
# Replace USER, PASSWORD, DATABASE, and CONNECTION_NAME with the
# values obtained when configuring your Cloud SQL instance.
CLOUDSQL_USER: Unique Name
CLOUDSQL_PASSWORD: Unique Password
CLOUDSQL_DSN: "mysql:dbname=<strong>Unique Name</strong>;unix_socket=/cloudsql/<strong>Unique Name:Location you Selected :my-demo-database-instance</strong>"
# [END gae_cloudsql_mysql_env]