0% found this document useful (0 votes)
14 views

Object Detection - Blocks, Python Functions, Projects _ PictoBlox Extension

Uploaded by

SIMRANJEET KAUR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Object Detection - Blocks, Python Functions, Projects _ PictoBlox Extension

Uploaded by

SIMRANJEET KAUR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

PICTOBLOX EXTENSION

Object Detection

Extension Description
AI to identify objects from images. It also tells the location and size of the objects identified.

Available in: Block Coding, Python Coding


Mode: Stage Mode
WiFi Required: No
Compatible Hardware in Block Coding: evive, Quarky, Arduino Uno, Arduino Mega, Arduino
Nano, ESP32, T-Watch, Boffin, micro:bit, TECbits, LEGO EV3, LEGO Boost, LEGO WeDo 2.0, Go DFA,
None
Compatible Hardware in Python: Quarky, None
Object Declaration in Python: od = ObjectDetection()
Extension Catergory: Artificial Intelligence

Introduction

Object detection is used to locate and identify multiple objects in digital photographs. It is a computer
vision technique that helps to detect objects as well as classify them. The object class may appear once or
several times in the image. For example, in the following image, object detection assists us to locate the
objects and classify them accordingly to the known set of objects.
One of the applications of Object detection includes Self-driving vehicles which detect objects in real-time
and act accordingly.
The object detection extension in PictoBlox allows you to detect the following 90 objects:

ID OBJECT (PAPER) SUPER CATEGORY

1 person person

2 bicycle vehicle

3 car vehicle

4 motorcycle vehicle

5 airplane vehicle

6 bus vehicle

7 train vehicle

8 truck vehicle

9 boat vehicle

10 traffic light outdoor

11 fire hydrant outdoor

12 street sign outdoor

13 stop sign outdoor

14 parking meter outdoor

15 bench outdoor
ID OBJECT (PAPER) SUPER CATEGORY

16 bird animal

17 cat animal

18 dog animal

19 horse animal

20 sheep animal

21 cow animal

22 elephant animal

23 bear animal

24 zebra animal

25 giraffe animal

26 hat accessory

27 backpack accessory

28 umbrella accessory

29 shoe accessory

30 eye glasses accessory

31 handbag accessory

32 tie accessory

33 suitcase accessory

34 frisbee sports

35 skis sports

36 snowboard sports

37 sports ball sports

38 kite sports

39 baseball bat sports

40 baseball glove sports


ID OBJECT (PAPER) SUPER CATEGORY

41 skateboard sports

42 surfboard sports

43 tennis racket sports

44 bottle kitchen

45 plate kitchen

46 wine glass kitchen

47 cup kitchen

48 fork kitchen

49 knife kitchen

50 spoon kitchen

51 bowl kitchen

52 banana food

53 apple food

54 sandwich food

55 orange food

56 broccoli food

57 carrot food

58 hot dog food

59 pizza food

60 donut food

61 cake food

62 chair furniture

63 couch furniture

64 potted plant furniture

65 bed furniture
ID OBJECT (PAPER) SUPER CATEGORY

66 mirror furniture

67 dining table furniture

68 window furniture

69 desk furniture

70 toilet furniture

71 door furniture

72 tv electronic

73 laptop electronic

74 mouse electronic

75 remote electronic

76 keyboard electronic

77 cell phone electronic

78 microwave appliance

79 oven appliance

80 toaster appliance

81 sink appliance

82 refrigerator appliance

83 blender appliance

84 book indoor

85 clock indoor

86 vase indoor

87 scissors indoor

88 teddy bear indoor

89 hair drier indoor

90 toothbrush indoor
ID OBJECT (PAPER) SUPER CATEGORY

91 hair brush indoor

Accessing Object Detection in Block Coding

Following is the process to add Object Detection capability to the PictoBlox Project.

1 Open PictoBlox and create a new file.

2 Select the coding environment as appropriate Coding Environment.


3 Next, click on the Add Extension button and add the Object Detection extension.

4 The object detection models will be downloaded, which may take a few seconds to load.
5 Once downloaded you will get a message saying “Model loaded successfully”.

6 You can find the object detection blocks available in the project.
Accessing Object Detection in Python Coding

Following is the process to add Object Detection capability to the PictoBlox Project.

1 Open PictoBlox and create a new file.

2 Select the coding environment as Block Coding.

3 Next, click on the Add Modules/Libraries button and add the Face Detection extension.
4 To access the library functions, you have to add the object declaration.

od = ObjectDetection()

Read More

PictoBlox Blocks

turn () video on stage with () % transparency block controls the control the camera feed on the stage.

This block is used to set the threshold for the confidence (accuracy) of object detection, 0 being low
confidence and 1 being high confidence. With the threshold value, you can set the level of confidence
required for object detection.

Once you have analyzed the images, you can use the get # of objects block to get the number of objects
recognized in the image.

4
The () of object () block reports the following attributes of the object: class, x position, y position, width,
height, and confidence.

The is () detected? block checks whether the selected class has been detected or not. If the class is
detected, then the block returns true; else, false.

The block returns the number of objects identified with the specified object class.

Block Coding Examples

1 Biodegradable vs Non Biodegradable Waste


A waste management system that will differentiate the waste
based on its type. If it detects biodegradable waste, the LEDs
Quarky’s matrix will turn green. If it’s non-biodegradable
waste, the LEDs will turn blue.

2 Object Detection on Stage


The example demonstrates how to run an object detection on
the stage and show all the objects with confidence.

3
Threshold Demonstration – Person Detection
The example demonstrates how to detect persons on the
stage with different confidence thresholds.

Python Functions

1
video()
The function is used to control the state of the camera.
Syntax: video(video_state = “on”, transparency = 1)

2
enablebox()
The function enables the automatic display of the box on object detection on the stage.
Syntax: enablebox()

3
disablebox()
The function disables the automatic display of the box on object detection on the stage.
Syntax: disablebox()

4
setthreshold()
This function is used to set the threshold for the confidence (accuracy) of object detection, 0 being low
confidence and 1 being high confidence.
Syntax: setthreshold(threshold = 0.5)

5
analysecamera()
This function is used to analyze the image received as input from the camera, for objects.
Syntax: analysecamera()
6
analysestage()
This function is used to analyze the image received as input from the stage, for objects.
Syntax: analysestage()

7
count()
This function returns the total number of objects detected in the camera feed or the stage.
Syntax: count()

8
x()
This function returns the x position of the object detected. You can specify the object for which the value
is needed. The position is mapped with the stage coordinates.
Syntax: x(object = 1)

9
y()
This function returns the y position of the object detected. You can specify the object for which the value
is needed. The position is mapped with the stage coordinates.
Syntax: y(object = 1)

10
width()
This function returns the width of the object detected. You can specify the object for which the value is
needed. The position is mapped with the stage coordinates.
Syntax: width(object = 1)

11
height()
This function returns the height of the object detected. You can specify the object for which the value is
needed. The position is mapped with the stage coordinates.
Syntax: height(object = 1)

12
classname()
This function is used to get the class name of the analyzed object.
Syntax: classname(object = 1)

13
confidence()
This function is used to get the confidence (accuracy) of object detection, 0 being low confidence and 1
being high confidence.
Syntax: confidence(object = 1)

14
isdetected()
The function returns whether the specified object is detected in the analysis or not.
Syntax: isdetected(object_name = “person”)

15
detectedcount()
The function returns whether the number of objects identified with the specified object class.
Syntax: detectedcount(object_name = “person”)

Python Coding Examples

1 Object Detection on Stage – Python


The example demonstrates how to run an object detection on
the stage and show all the objects with confidence.

2 Person Detector – Python


The example demonstrates how to detect persons on the
stage with different confidence thresholds.

3 Waste Classifier – Python


A waste management system that will differentiate the waste
based on its type in Python Coding Environment. If it detects
biodegradable waste, the LEDs Quarky’s matrix will turn
green. If it’s non-biodegradable waste, the LEDs will turn blue.
Company
About Us
Blog
Partners and Distributors
Terms and Conditions
Privacy Policy
Careers

Community
Codeavour - AI Competition
Community Projects
Projects by STEMpedia
Example Projects
International Python Bootcamp
International Junior Blocks Bootcamp
International 3D and XR Studio Bootcamp

Products
Quarky - AI & Robotics Kit
Quarky Addon Kits
evive - STEM Kit
PictoBlox Software
Dabble App

School Programs
AI & Robotics Lab
Atal Tinkering Labs
STEM Innovation Lab
CBSE Aligned Coding & AI Lab
ICSE Aligned Robotics & AI Lab

Impact Programs
CSR & Government Impact Program

Learning Resources
Education Center
Courses & Teacher Resources
Product Documentation
Quarky Kits
evive Kits
PictoBlox Software
PictoBlox Extensions & Libraries
Dabble App
Arduino with PictoBlox

Get in Touch
Contact Us
Book a Demo
Request a Quote

Follow Us

PictoBlox - Block & Python Coding for Kids

Dabble App - One App. Infinite Control.

Copyright 2024 – Agilo Research Pvt. Ltd. All rights reserved – Terms & Condition | Privacy Policy

You might also like