Skip to content

Xenia101/Simple-Object-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Object Detection

A Simple Object Detection in python

USAGE

  1. download models yolo.h5 - YOLOv3

  2. Save the file in ./models

  3. Add to path

model_path = "./models/yolo.h5"
  1. Name the input/output file name
input_path = "./input/input.jpg"
output_path = "./output/output.jpg"
  1. Run

EXAMPLE

Load Model & Detection

detector.setModelTypeAsYOLOv3()
detector.setModelPath(model_path)
detector.loadModel()
detection = detector.detectObjectsFromImage(input_image=input_path, output_image_path=output_path)

Print percentage_probability & name of object

print(list(x["name"] for x in detection))
print(list(x["percentage_probability"] for x in detection))

Intput

Output