Pas encore de compte ?
Testé sous Anaconda et Python 3.7
from imageai.Detection import ObjectDetection detector = ObjectDetection() detector.setModelTypeAsRetinaNet() detector.setModelTypeAsYOLOv3() detector.setModelTypeAsTinyYOLOv3() detector.setModelPath("models/yolo-tiny.h5") detector.loadModel() detections = detector.detectObjectsFromImage(input_image="input/object-detection-with-imageai-python-1.jpg", output_image_path="output/imagenew.jpg", minimum_percentage_probability=30)
ImageAI
Copyright (c) 2019 MOSES OLAFENWA
Téléchargez le fichier de modèle TinyYOLOv3 qui contient le modèle de classification qui sera utilisé pour la détection d'objets
Testé sous Anaconda et Python 3.7
from imageai.Detection import VideoObjectDetection import os execution_path = os.getcwd() detector = VideoObjectDetection() detector.setModelTypeAsYOLOv3() detector.setModelPath( os.path.join(execution_path , "yolo.h5")) # Download the model via this link https://github.com/OlafenwaMoses/ImageAI/releases/tag/1.0 detector.loadModel() video_path = detector.detectObjectsFromVideo(input_file_path=os.path.join(execution_path, "traffic.mp4"), output_file_path=os.path.join(execution_path, "traffic_detected") , frames_per_second=20, log_progress=True) print(video_path)
ImageAI
Copyright (c) 2019 MOSES OLAFENWA
Bienvenu, je m’appelle Eric Soupet et je suis l'administrateur du site elodees.com. elodees.com est un état de l'art de l'Intelligence Artificielle et se veut collaboratif, vous pouvez dès à présent proposer du contenu tels que des articles, des événements, des tutoriels, ... alors n'hésitez pas !
Crédit des images de la plate-forme : Pixabay - Pixabay License | Pexels - Pexels License