A Beginner's Guide to AI and Testing
  • Welcome AI Testers!
  • TUTORIAL
    • Exercise: Object Detection
    • Exercise: Try Chopper Yourself
    • Exercise: Python Chopper
  • Demo: Build Your Own Chopper
  • Exercise: Build Your Own Agent
  • Demo: AGENT Exploration
  • Demo: AGENT Test Generation
  • SELF STUDY
    • How-to: Teachable Machine
    • How-to: Build Your Own Classifier
    • How-to: AI Using Appium
    • How-to: Template Matching
Powered by GitBook
On this page
  • Updated Instructions (2024)
  • Open Notebook on Google Colab
  • Execute Element Detection Model
  • Viewing the Results
  • Congratulations!
  • Legacy Instructions (Deprecated)
  • Set Up Your Jupyter Server
  • Launch Chopper Notebook
  • Execute Element Detection Model
  • Viewing the Results
  • Congratulations!

Was this helpful?

  1. TUTORIAL

Exercise: Python Chopper

In this exercise, you can try out an object detection model trained internally at dev-tools.ai.

PreviousExercise: Try Chopper YourselfNextDemo: Build Your Own Chopper

Last updated 1 year ago

Was this helpful?

Updated Instructions (2024)

Open Notebook on Google Colab

Navigate to and click on "Open in Colab" at the top.

Execute Element Detection Model

Follow the steps on the notebook, executing each of the Python code blocks in the order in which they appear. To execute a code block, click the Play icon to the left of the block.

Note: After executing the first code block, an upload file widget will appear. This widget allows you to upload an image file from your computer. This, in turn, is the image that will be sent to the deep learning model for object detection purposes.

After uploading a file, simply follow the instructions in the notebook, executing each of the code blocks in the order in which they appear.

Note that some steps may take a few seconds to execute.

Viewing the Results

When viewing the results, you can see all detected elements, each with a screenshot + bounding box, the element type, and a confidence score between 0 and 1.

See a full example below:

Discussion Topic: How useful do you think this would be for testing purposes? Note that this approach allows us to locate elements on an application screen without using a Document Object Model (DOM) or similar page source for mobile applications.

What are some drawbacks of relying on the DOM or on page source?

Congratulations!

For making it this far. Perhaps even without knowing it, you just used deep learning to identify elements using only a screenshot! How cool is that?

Legacy Instructions (Deprecated)

In this exercise, you will:

Set Up Your Jupyter Server

Enter the following credentials:

  • Username should be your e-mail address or first + last name.

  • Password should be admin.

Your e-mail information is not being collected. We need to ensure your username is unique when considering all tutorial attendees.

Click on Sign In.

After a few short moments, your unique Jupyter notebook server will be created for you.

Launch Chopper Notebook

Double click the chopper.ipynb notebook.

Execute Element Detection Model

Follow the steps on the notebook, executing each of the Python code blocks in the order in which they appear. To execute a code block, first, click the block, then click the Play icon.

Note: After executing the first code block, an upload file widget will appear. This widget allows you to upload an image file from your computer. This, in turn, is the image that will be sent to the deep learning model for object detection purposes.

After uploading a file, simply follow the instructions in the Jupyter notebook, executing each of the code blocks in the order in which they appear.

Note that some steps may take a few seconds to execute! We're running deep learning models behind the scenes!

Viewing the Results

When viewing the results, you will be able to see a Screenshot with Bounding Box, and a Chopped Element screenshot for every resulting element that is found.

See a full example below:

Discussion Topic: How useful do you think this would be for testing purposes? Note that this approach allows us to locate elements on an application screen without using a Document Object Model (DOM) or similar page source for mobile applications.

What are some drawbacks of relying on the DOM or on page source?

Congratulations!

For making it this far. Perhaps even without knowing it, you just used deep learning to identify elements using only a screenshot! How cool is that?

, powered by JupyterHub

the chopper.ipynb Python notebook

the specialized element detection model

produced by the element detection model

Navigate to and make sure you arrive at the following login screen:

https://jupyterhub.dionny.dev
Create your very own Jupyter server
Launch
Execute
View the results
https://github.com/dionny/ai-tutorial-notebooks/blob/main/chopper.ipynb
Widget For Uploading a File
Jupyter Server Login Screen
Your Own Unique Jupyter Server
Executing a Code Block on Jupyter
Widget For Uploading a File