
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Configure a Service Account & IAM permissions
/ 20
Configure credential file for a Service Account
/ 20
Modify the application to save text from images to Cloud Storage
/ 20
Modify the appliction to translate text using the Language API
/ 20
Query the BigQuery table
/ 20
In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.
When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.
To score 100% you must successfully complete all tasks within the time period!
This lab is recommended for students who have enrolled in the Use Machine Learning APIs on Google Cloud course. Are you ready for the challenge?
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
You have started a new role as a member of the Analytics team for Jooli Inc. You are expected to help with the development and assessment of data sets for your company's Machine Learning projects. Common tasks include preparing, cleaning, and analyzing diverse data sets.
You are expected to have the skills and knowledge for these tasks, so don't expect step-by-step guides to be provided.
You have been asked to develop a process to analyze sets of images of signage to extract and translate any text in the images. This extracted text information will be used to help classify the images as part of a machine learning project that will use this image dataset for model training and evaluation. The images all contain text, but the text may be in any language. The images are stored in a Cloud Storage bucket that has been provided for you.
You must use a Python script to process each of the image files by sending them to the Google Vision API to identify the text in the image. The text from each image must be saved back to files on Cloud Storage, with a separate file for the text from each image. If the text locale is not
This diagram outlines the process.
The processed text data must then be written out to a pre-existing BigQuery table called image_text_detail
in a dataset in your project called image_classification_dataset
.
A colleague on your team had started to work on the code to process the images based on a Python script previously used to process a set of text files using the Natural Language API. Your colleague has been moved to a separate project and you must now complete the task.
Most of the work on the script has been completed and the version you have been given will access a storage bucket, and iterate over every image file it finds. However the specific API calls that need to be made to find the text in each image and then send that text to the Translation API have not yet been implemented.
You have been given a copy of the work in progress Python script and a set of sample images in a Cloud Storage bucket that is named after your lab Project ID.
Your colleague identified the unfinished parts of the script and commented on the API calls that need to be made. There are three unfinished parts in the script that you must complete to make the correct Machine Learning API calls. All of them are preceded with a comment using the label # TBD:
.
The final line of code uploads the result data to BigQuery. In the script, this line is disabled by a comment character. When you are satisfied that the rest of the script is working, remove the comment character to enable the final line.
Before you work on the script, you must prepare your environment by creating a service account with the correct permissions and download the credential file for that account. Once you have the service account credentials, you can modify the Python script and use it to process the image files.
To complete the challenge, the original extracted text, locale, and translated text data for all of the images must be loaded into the BigQuery table called image_text_detail
. The code to do this is in the script but you must remove the comment characters to enable the line of code at the end of the script.
Once you have successfully processed the image files using the updated Python script and uploaded to data to BigQuery, you must confirm that image data has been successfully processed by running the following Query in BigQuery:
This query will report the number of signs of each language type it has found in the set of sample images.
Copy the file analyze-images-v2.py
from the Cloud Storage bucket that was created for you into the Cloud Shell.
You must modify this Python script to extract text from the image files stored in your project bucket and then save the text data for each file into a text file that is written back to the same bucket. Remember, the parts of the script where you need to add in the code to access the APIs are marked with the comment # TBD
.
After you modify the first part of the script to use the Cloud Vision API to extract text data from the image files, you should run the partially completed script to check your progress to make sure you are on the right track.
Now modify the second part of the Python script to identify any
Tip 1: You must set an environment variable to provide the details of the credentials file that should be used by the Python script to access the Google Cloud APIs.
Tip 2: You can find details about the Vision API Client document_text_detection API call in the Python API Documentation reference page for the Vision API Client and the details of the Vision API annotation response object in the Python API Documentation reference page for the Vision API Objects.
Tip 3: For details about the Translation API Client translate API call, see the Python API Documentation for the Translation V2 API Client.
You have developed a process to analyze images of signage and extract and translate the text in the images.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated Aug 30, 2024
Lab Last Tested Aug 30, 2024
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one