Wednesday, March 3, 2021
  • Setup menu at Appearance » Menus and assign menu to Top Bar Navigation
Advertisement
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News
No Result
View All Result
NikolaNews
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News
No Result
View All Result
NikolaNews
No Result
View All Result
Home Neural Networks

YOLO: Object Detection in Images and Videos | by Predictive Hacks

September 10, 2020
in Neural Networks
YOLO: Object Detection in Images and Videos | by Predictive Hacks
588
SHARES
3.3k
VIEWS
Share on FacebookShare on Twitter

In another post, we explained how to apply Object Detection in Tensorflow. In this post, we will provide some examples of how you can apply Object Detection using the YOLO algorithm in Images and Videos. For our example, we will use the ImageAI Python library where with a few lines of code we can apply object detection.

Below we represent the code for Object Detection in Images.

You might also like

The Symbolic World: Raising A Turing’s Child Machine (1/2) | by Puttatida Mahapattanakul | Feb, 2021

The Ways in Which Big Data can Transform Talent Management and Human Resources | by Amelia Jackson | Feb, 2021

Why small businesses and startups should always use Analytics and AI | by Yogesh Chauhan | Feb, 2021

from imageai.Detection import ObjectDetection
import os
execution_path = os.getcwd()
detector = ObjectDetection()
detector.setModelTypeAsYOLOv3()
detector.setModelPath( os.path.join(execution_path , "yolo.h5"))
detector.loadModel()
detections = detector.detectObjectsFromImage(input_image=os.path.join(execution_path , "cycling001.jpg"), output_image_path=os.path.join(execution_path , "new_cycling001.jpg"), minimum_percentage_probability=30)for eachObject in detections: print(eachObject["name"] , " : ", eachObject["percentage_probability"], " : ", eachObject["box_points"] )print("--------------------------------")

And we get:

car  :  99.66793060302734  :  [395, 248, 701, 405]
--------------------------------
bicycle : 66.10226035118103 : [81, 270, 128, 324]
--------------------------------
bicycle : 99.86441731452942 : [242, 351, 481, 570]
--------------------------------
person : 99.92108345031738 : [269, 186, 424, 540]
--------------------------------

We also represent the Original and the Detected Image

Notice that it was able to detect the bicycle behind-A-M-A-Z-I-N-G!!!

ML Jobs

Let’s provide another example of the Original and the Detected image

Notice that it detected the bed, the laptop and the two persons!

1. Microsoft Azure Machine Learning x Udacity — Lesson 4 Notes

2. Fundamentals of AI, ML and Deep Learning for Product Managers

3. Roadmap to Data Science

4. Work on Artificial Intelligence Projects

Assume that you have a video in your PC called “Traffic.mp4”, then by running this code you will be able to get the detected objects:

from imageai.Detection import VideoObjectDetection
import os
execution_path = os.getcwd()
detector = VideoObjectDetection()
detector.setModelTypeAsYOLOv3()
detector.setModelPath( os.path.join(execution_path , "yolo.h5"))
detector.loadModel()video_path = detector.detectObjectsFromVideo(input_file_path=os.path.join(execution_path, "Traffic.mp4"),output_file_path=os.path.join(execution_path, "New_Traffic"), frames_per_second=20, log_progress=True)print(video_path)

And the detected video is here:

Let’s provide another example of a Video:

The following examples show how we can use our USB camera for Object Detection:

from imageai.Detection import VideoObjectDetectionimport os
import cv2
execution_path = os.getcwd()
camera = cv2.VideoCapture(0)
detector = VideoObjectDetection()
detector.setModelTypeAsYOLOv3()
detector.setModelPath(os.path.join(execution_path , "yolo.h5"))
detector.loadModel()
video_path = detector.detectObjectsFromVideo(camera_input=camera,output_file_path=os.path.join(execution_path, "camera_detected_video"), frames_per_second=20, log_progress=True, minimum_percentage_probability=30)print(video_path)

Below I represent just a snapshot of the recorded video of my office while I was coding. As you can see it was able to detect the books of the library behind me!

Credit: BecomingHuman By: Predictive Hacks

Previous Post

InMarket buys NinthDecimal to compete with Foursquare more effectively

Next Post

Qeexo AutoML Enables Machine Learning on Arm Cortex-M0 and Cortex-M0+

Related Posts

The Symbolic World: Raising A Turing’s Child Machine (1/2) | by Puttatida Mahapattanakul | Feb, 2021
Neural Networks

The Symbolic World: Raising A Turing’s Child Machine (1/2) | by Puttatida Mahapattanakul | Feb, 2021

March 3, 2021
The Ways in Which Big Data can Transform Talent Management and Human Resources | by Amelia Jackson | Feb, 2021
Neural Networks

The Ways in Which Big Data can Transform Talent Management and Human Resources | by Amelia Jackson | Feb, 2021

March 3, 2021
Why small businesses and startups should always use Analytics and AI | by Yogesh Chauhan | Feb, 2021
Neural Networks

Why small businesses and startups should always use Analytics and AI | by Yogesh Chauhan | Feb, 2021

March 2, 2021
Data Annotation Service: a Potential and Problematic Industry Behind AI | by ByteBridge
Neural Networks

Data Annotation Service: a Potential and Problematic Industry Behind AI | by ByteBridge

March 2, 2021
Can India beat the global AI challenge? Can we avoid huge job extinction here? | by Yogesh Chauhan | Jan, 2021
Neural Networks

Can India beat the global AI challenge? Can we avoid huge job extinction here? | by Yogesh Chauhan | Jan, 2021

March 2, 2021
Next Post
Qeexo AutoML Enables Machine Learning on Arm Cortex-M0 and Cortex-M0+

Qeexo AutoML Enables Machine Learning on Arm Cortex-M0 and Cortex-M0+

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

Plasticity in Deep Learning: Dynamic Adaptations for AI Self-Driving Cars

Plasticity in Deep Learning: Dynamic Adaptations for AI Self-Driving Cars

January 6, 2019
Microsoft, Google Use Artificial Intelligence to Fight Hackers

Microsoft, Google Use Artificial Intelligence to Fight Hackers

January 6, 2019

Categories

  • Artificial Intelligence
  • Big Data
  • Blockchain
  • Crypto News
  • Data Science
  • Digital Marketing
  • Internet Privacy
  • Internet Security
  • Learn to Code
  • Machine Learning
  • Marketing Technology
  • Neural Networks
  • Technology Companies

Don't miss it

Microsoft account hijack vulnerability earns bug bounty hunter $50,000
Internet Security

Microsoft account hijack vulnerability earns bug bounty hunter $50,000

March 3, 2021
New Chrome 0-day Bug Under Active Attacks – Update Your Browser ASAP!
Internet Privacy

New Chrome 0-day Bug Under Active Attacks – Update Your Browser ASAP!

March 3, 2021
6 Ways Machine Learning Can Improve Supply Chain’s Bottom Line
Machine Learning

6 Ways Machine Learning Can Improve Supply Chain’s Bottom Line

March 3, 2021
Malaysia Airlines suffers data security ‘incident’ spanning nine years
Internet Security

Malaysia Airlines suffers data security ‘incident’ spanning nine years

March 3, 2021
URGENT — 4 Actively Exploited 0-Day Flaws Found in Microsoft Exchange
Internet Privacy

URGENT — 4 Actively Exploited 0-Day Flaws Found in Microsoft Exchange

March 3, 2021
This Protein Therapeutics Company Integrates Wet Lab For High-Speed Characterization With Machine Learning Technologies To Guide The Search For Better Antibodies
Machine Learning

This Protein Therapeutics Company Integrates Wet Lab For High-Speed Characterization With Machine Learning Technologies To Guide The Search For Better Antibodies

March 3, 2021
NikolaNews

NikolaNews.com is an online News Portal which aims to share news about blockchain, AI, Big Data, and Data Privacy and more!

What’s New Here?

  • Microsoft account hijack vulnerability earns bug bounty hunter $50,000 March 3, 2021
  • New Chrome 0-day Bug Under Active Attacks – Update Your Browser ASAP! March 3, 2021
  • 6 Ways Machine Learning Can Improve Supply Chain’s Bottom Line March 3, 2021
  • Malaysia Airlines suffers data security ‘incident’ spanning nine years March 3, 2021

Subscribe to get more!

© 2019 NikolaNews.com - Global Tech Updates

No Result
View All Result
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News

© 2019 NikolaNews.com - Global Tech Updates