×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

How can we organize the extracted object information in a tabular format using the pandas data frame?

by EITCA Academy / Saturday, 30 December 2023 / Published in Artificial Intelligence, EITC/AI/GVAPI Google Vision API, Advanced images understanding, Objects detection, Examination review

To organize extracted object information in a tabular format using the pandas data frame in the context of Advanced Images Understanding and Object Detection with the Google Vision API, we can follow a step-by-step process.

Step 1: Importing the Required Libraries
First, we need to import the necessary libraries for our task. In this case, we will import the pandas library, which provides powerful data manipulation capabilities, and the google.cloud.vision library, which allows us to interact with the Google Vision API.

python
import pandas as pd
from google.cloud import vision

Step 2: Authenticating and Initializing the Google Vision API Client
Next, we need to authenticate and initialize the Google Vision API client. This requires setting up a Google Cloud project, enabling the Vision API, and obtaining the necessary credentials. Once we have the credentials, we can create a client object.

python
# Replace 'path/to/credentials.json' with the actual path to your credentials file
client = vision.ImageAnnotatorClient.from_service_account_json('path/to/credentials.json')

Step 3: Uploading and Analyzing the Image
To extract object information from an image, we need to upload the image to the Google Vision API and analyze it. We can use the `client.annotate_image()` method to perform this task. The response from the API will contain the detected objects along with their corresponding bounding boxes.

python
# Replace 'path/to/image.jpg' with the actual path to your image file
with open('path/to/image.jpg', 'rb') as image_file:
    content = image_file.read()

image = vision.Image(content=content)
response = client.annotate_image({'image': image}, features=[{'type': vision.Feature.Type.OBJECT_LOCALIZATION}])

Step 4: Extracting Object Information and Creating the Data Frame
Once we have the response from the API, we can extract the object information and create a data frame using the pandas library. We will iterate over the response's localized_object_annotations field, which contains the detected objects and their bounding box information. For each object, we will extract the object's name, confidence score, and bounding box coordinates.

python
objects = []
for obj in response.localized_object_annotations:
    name = obj.name
    score = obj.score
    vertices = [(vertex.x, vertex.y) for vertex in obj.bounding_poly.normalized_vertices]
    objects.append({'Name': name, 'Score': score, 'Bounding Box': vertices})

df = pd.DataFrame(objects)

Step 5: Displaying the Data Frame
Finally, we can display the created data frame to visualize the extracted object information in a tabular format.

python
print(df)

By following these steps, we can organize the extracted object information in a tabular format using the pandas data frame. The resulting data frame will contain columns representing the object's name, confidence score, and bounding box coordinates.

Example Output:

         Name     Score                             Bounding Box
0        Chair    0.987     [(0.123, 0.456), (0.789, 0.456), ...]
1        Table    0.876     [(0.234, 0.567), (0.890, 0.567), ...]
2         Lamp    0.765     [(0.345, 0.678), (0.901, 0.678), ...]
3  Wall Clock    0.654     [(0.456, 0.789), (0.012, 0.789), ...]

In this example, the data frame contains four detected objects along with their corresponding confidence scores and bounding box coordinates.

Other recent questions and answers regarding Advanced images understanding:

  • What are some predefined categories for object recognition in Google Vision API?
  • What is the recommended approach for using the safe search detection feature in combination with other moderation techniques?
  • How can we access and display the likelihood values for each category in the safe search annotation?
  • How can we obtain the safe search annotation using the Google Vision API in Python?
  • What are the five categories included in the safe search detection feature?
  • How does the Google Vision API's safe search feature detect explicit content within images?
  • How can we visually identify and highlight the detected objects in an image using the pillow library?
  • How can we extract all the object annotations from the API's response?
  • What libraries and programming language are used to demonstrate the functionality of the Google Vision API?
  • How does the Google Vision API perform object detection and localization in images?

View more questions and answers in Advanced images understanding

More questions and answers:

  • Field: Artificial Intelligence
  • Programme: EITC/AI/GVAPI Google Vision API (go to the certification programme)
  • Lesson: Advanced images understanding (go to related lesson)
  • Topic: Objects detection (go to related topic)
  • Examination review
Tagged under: Artificial Intelligence, Data Frame, Google Cloud Vision API, Object Detection, Pandas, Python
Home » Advanced images understanding / Artificial Intelligence / EITC/AI/GVAPI Google Vision API / Examination review / Objects detection » How can we organize the extracted object information in a tabular format using the pandas data frame?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.

Eligibility for EITCA Academy 80% EITCI DSJC Subsidy support

80% of EITCA Academy fees subsidized in enrolment by

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2025  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    Chat with Support
    Chat with Support
    Questions, doubts, issues? We are here to help you!
    End chat
    Connecting...
    Do you have any questions?
    Do you have any questions?
    :
    :
    :
    Send
    Do you have any questions?
    :
    :
    Start Chat
    The chat session has ended. Thank you!
    Please rate the support you've received.
    Good Bad