1640374500
Erfahren Sie, wie Sie YOLOv5 mit Ihrem benutzerdefinierten Datensatz trainieren
YOLO (You Only Look Once) ist einer der beliebtesten Deep-Learning-basierten Objekterkennungsalgorithmen. Heute werden wir sehen, wie wir unseren eigenen Objektdetektor mit der neuesten YOLO-Variante YOLOv5 trainieren können.
Wir verwenden ein Straßenschild-Dataset.
Das erste, was Sie tun müssen, ist, das Repository von YOLOv5 GitHub zu klonen und seine Anforderungen herunterzuladen ( für einige Abhängigkeiten müssen Sie möglicherweise sudo ausführen ).
Geben Sie im Terminal Folgendes ein:
git clone https://github.com/ultralytics/yolov5
Wenn Sie YOLOv5 in einer neuen Umgebung ausführen möchten, ist dies der richtige Moment, um eine zu erstellen.
Nach der Aktivierung müssen Sie im nächsten Schritt die erforderlichen Abhängigkeiten installieren.
pip install -r yolov5/requirements.txt
Um die Einrichtung abzuschließen, importieren wir nach der Installation der Anforderungen die Module, die wir verwenden werden.
import torch
from IPython.display import Image # for displaying images
import os
import random
import shutil
from sklearn.model_selection import train_test_split
import xml.etree.ElementTree as ET
from xml.dom import minidom
from tqdm import tqdm
from PIL import Image, ImageDraw
import numpy as np
import matplotlib.pyplot as plt
random.seed(42)
Wir verwenden ein Dataset zur Erkennung von Verkehrszeichen von MakeML, das Sie hier finden können .
Wir haben hauptsächlich vier Klassen: Ampel, Haltestelle, Tempolimit und Zebrastreifen.
Wir verwenden einen relativ kleinen Datensatz (idealerweise möchten Sie einen größeren, um die YOLO-Funktionen voll auszuschöpfen), dies dient dem schnellen Modell-Prototyping, sodass der Trainingsprozess nicht viel Zeit in Anspruch nimmt und Sie problemlos mit verschiedenen Hyperparametern experimentieren können und Konfigurationen.
Der nächste Schritt besteht darin, einen Ordner für unseren Datensatz zu erstellen:
mkdir road_sign_dataset
cd road_sign_dataset
Laden Sie als Nächstes den Datensatz herunter:
wget -O RoadSignDetectionDataset.zip https://arcraftimages.s3-accelerate.amazonaws.com/Datasets/RoadSigns/RoadSignsPascalVOC.zip?region=us-east-2
Und entpacken Sie es.
unzip RoadSignDetectionDataset.zip
Nachdem wir den Datensatz heruntergeladen haben, müssen wir die Anmerkungen in ein von YOLO akzeptiertes Format konvertieren.
Für unseren Datensatz ist das Annotationsformat PASCAL VOC XML, das sehr beliebt ist. Das bedeutet, dass Sie leicht Online-Tools zum Konvertieren des Anmerkungsformats finden können.
YOLO v5 erwartet für jedes Bild Anmerkungen in Form einer .txt
Datei, wobei jede Zeile der Textdatei einen Begrenzungsrahmen beschreibt, wie im Bild:
Es ist eine Zeile pro Objekt mit diesen Spezifikationen:
class
x_center
y_center
width
height
Format.Wir werden jetzt eine Funktion schreiben, die Informationen aus der VOC-Datei extrahiert und in einem Wörterbuch speichert.
# Function to get the data from XML Annotation
def extract_info_from_xml(xml_file):
root = ET.parse(xml_file).getroot()
# Initialise the info dict
info_dict = {}
info_dict['bboxes'] = []
# Parse the XML
for elem in root:
# Get the file name
if elem.tag == "filename":
info_dict['filename'] = elem.text
# Get the image size
elif elem.tag == "size":
image_size = []
for subelem in elem:
image_size.append(int(subelem.text))
info_dict['image_size'] = tuple(image_size)
# Get details of the bounding box
elif elem.tag == "object":
bbox = {}
for subelem in elem:
if subelem.tag == "name":
bbox["class"] = subelem.text
elif subelem.tag == "bndbox":
for subsubelem in subelem:
bbox[subsubelem.tag] = int(subsubelem.text)
info_dict['bboxes'].append(bbox)
return info_dict
Fühlen Sie sich frei, es an einer Anmerkungsdatei zu testen.
Wir müssen nun die in diesem Wörterbuch gespeicherten Informationen in Annotationen im YOLO v5-Stil umwandeln und in eine txt
Datei schreiben . Wenn Sie einen anderen Datensatz gewählt haben und ein anderes Anmerkungsformat haben, müssen Sie die Funktion an Ihr eigenes Format anpassen.
# Dictionary that maps class names to IDs
class_name_to_id_mapping = {"trafficlight": 0,
"stop": 1,
"speedlimit": 2,
"crosswalk": 3}
# Convert the info dict to the required yolo format and write it to disk
def convert_to_yolov5(info_dict):
print_buffer = []
# For each bounding box
for b in info_dict["bboxes"]:
try:
class_id = class_name_to_id_mapping[b["class"]]
except KeyError:
print("Invalid Class. Must be one from ", class_name_to_id_mapping.keys())
# Transform the bbox co-ordinates as per the format required by YOLO v5
b_center_x = (b["xmin"] + b["xmax"]) / 2
b_center_y = (b["ymin"] + b["ymax"]) / 2
b_width = (b["xmax"] - b["xmin"])
b_height = (b["ymax"] - b["ymin"])
# Normalise the co-ordinates by the dimensions of the image
image_w, image_h, image_c = info_dict["image_size"]
b_center_x /= image_w
b_center_y /= image_h
b_width /= image_w
b_height /= image_h
#Write the bbox details to the file
print_buffer.append("{} {:.3f} {:.3f} {:.3f} {:.3f}".format(class_id, b_center_x, b_center_y, b_width, b_height))
# Name of the file which we have to save
save_file_name = os.path.join("annotations", info_dict["filename"].replace("png", "txt"))
# Save the annotation to disk
print("\n".join(print_buffer), file= open(save_file_name, "w"))
Schließlich konvertieren wir alle xml
Anmerkungen in txt
solche im YOLO-Stil .
# Get the annotations
annotations = [os.path.join('annotations', x) for x in os.listdir('annotations') if x[-3:] == "xml"]
annotations.sort()
# Convert and save the annotations
for ann in tqdm(annotations):
info_dict = extract_info_from_xml(ann)
convert_to_yolov5(info_dict)
annotations = [os.path.join('annotations', x) for x in os.listdir('annotations') if x[-3:] == "txt"]
Beachten Sie, dass wenn das von Ihnen gewählte Dataset keine Anmerkungen enthält, Sie es nicht umgehen können. Sie müssen dies manuell tun.
Zu Ihrem Glück bietet das Internet verschiedene Lösungen für die manuelle Kennzeichnung Ihres Datensatzes:
Auch wenn Sie auf einen Datensatz mit YOLO-kompatiblen Anmerkungen stoßen, brauchen Sie diesen ganzen Durcheinander nicht, Sie können im Grunde genommen zum Schulungskapitel springen.
Wie immer ist es sehr wichtig, Ihren Datensatz in Trainings-, Validierungs- und Testordner aufzuteilen. Wir werden einen Ansatz von 80%, 10%, 10% durchführen, aber Sie können ihn gerne ändern!
# Read images and annotations
images = [os.path.join('images', x) for x in os.listdir('images')]
annotations = [os.path.join('annotations', x) for x in os.listdir('annotations') if x[-3:] == "txt"]
images.sort()
annotations.sort()
# Split the dataset into train-valid-test splits
train_images, val_images, train_annotations, val_annotations = train_test_split(images, annotations, test_size = 0.2, random_state = 42)
val_images, test_images, val_annotations, test_annotations = train_test_split(val_images, val_annotations, test_size = 0.5,
Wir brauchen jetzt Ordner, um die neue Version des Datensatzes zu speichern
!mkdir images/train images/val images/test annotations/train annotations/val annotations/test
Und jetzt verschieben wir die Bilder!
def move_files_to_folder(list_of_files, destination_folder):
for f in list_of_files:
try:
shutil.move(f, destination_folder)
except:
print(f)
assert False
# Move the splits into their folders
move_files_to_folder(train_images, 'images/train')
move_files_to_folder(val_images, 'images/val/')
move_files_to_folder(test_images, 'images/test/')
move_files_to_folder(train_annotations, 'annotations/train/')
move_files_to_folder(val_annotations, 'annotations/val/')
move_files_to_folder(test_annotations, 'annotations/test/')
Benennen Sie den annotations
Ordner in um labels
, da YOLO v5 erwartet, dass sich dort die Anmerkungen befinden.
Da unser Datensatz nun fertig ist, müssen wir unseren benutzerdefinierten Objektdetektor trainieren!
Wir werden das yolov5-Repository selbst verwenden, aber zuerst sehen wir uns die Flags an, die wir verwenden werden.
img
: die Größe des Bildes, es ist ein quadratisches.batch
: die Losgrößeepochs
: Anzahl der Epochendata
: Daten-YAML-Datei, die Informationen zum Datensatz enthält (Pfad der Bilder, Labels)workers
: Anzahl der CPU-Workercfg
: Konfigurationsdatei der Modellarchitektur. Es stehen 4 Auswahlmöglichkeiten zur Verfügung: yolo5s.yaml
, yolov5m.yaml
, yolov5l.yaml
, yolov5x.yaml
. Die Größe und Komplexität dieser Modelle nimmt in aufsteigender Reihenfolge zu und Sie können ein Modell auswählen, das der Komplexität Ihrer Objekterkennungsaufgabe entspricht.weights
: Vortrainierte Gewichte, mit denen Sie mit dem Training beginnen möchten. Wenn Sie von Grund auf neu trainieren möchten, verwenden Sie--weights ' '
name
: verschiedene Dinge über das Training, wie zum Beispiel Zugprotokolle. Trainingsgewichte werden in einem Ordner namens . gespeichertruns/train/name
hyp
: YAML-Datei, die Hyperparameteroptionen beschreibt. Wenn nicht angegeben, wird die Datei data/hyp.scratch.yaml
verwendet.Erstellen Sie eine neue Datei namens road_sign_data.yaml
und legen Sie sie in den yolov5/data
Ordner. Füllen Sie es dann mit folgendem aus.
YOLO v5 erwartet, die Trainingslabels für die Bilder in dem Ordner zu finden, dessen Name durch Ersetzen von „images“ durch „labels“ im Pfad zu den Datensatzbildern abgeleitet werden kann. Im obigen Beispiel sucht YOLO v5 beispielsweise nach Zugbezeichnungen in ../road_sign_dataset/labels/train/
.
Um das Tutorial einfach und kurz zu halten, werden wir uns weder die Hyperparameters-Konfigurationsdatei noch die Architekturdatei ansehen. Bei Bedarf können Sie sie auch optimieren.
Es ist ratsam, mit dem kleinsten Modell zu beginnen, damit wir sehen können, wie es sich mit unserem Datensatz verhält, und es von dort aus skalieren können.
Um den Trainingsprozess zu starten, vergewissern Sie sich, dass Sie sich im Ordner des yolov5-Repositorys befinden, und zwar einfach vom Terminal aus:
python train.py --img 640 --cfg yolov5s.yaml --hyp hyp.scratch.yaml --batch 32 --epochs 100 --data road_sign_data.yaml --weights yolov5s.pt --workers 24 --name yolo_road_det
Sie können es nach Ihren Bedürfnissen ändern. Der Vorgang kann bis zu 30 Minuten dauern, hängt jedoch von Ihrer Hardware ab.
Nun, jetzt haben Sie Ihren eigenen Objektdetektor! Herzlichen Glückwunsch, dass Sie so weit gekommen sind!
Nun, ich glaube, Sie möchten es testen, und es gibt verschiedene Möglichkeiten, dies zu tun, indem Sie die detect.py
Datei verwenden (einzelnes Bild, Ordner, Video, Webcam).
python detect.py --source ../road_sign_dataset/images/test/ --weights runs/train/yolo_road_det/weights/best.pt --conf 0.25 --name yolo_road_det
source
: Definiert die Quelle des Inferenztests, mehr dazu in einer Minute.weights
: „best.pt“ enthält die leistungsstärksten Gewichte, die während des Trainings gespeichert wurden.conf
: Definiert den Schwellenwert für das Vertrauen.name
: wo die Erkennungen gespeichert werden.Außer dem Datensatzordner können Sie andere Eingaben für das Quellkennzeichen verwenden.
Sie sind jetzt fertig! Sie haben Ihren eigenen Objektdetektor!
1640374500
Erfahren Sie, wie Sie YOLOv5 mit Ihrem benutzerdefinierten Datensatz trainieren
YOLO (You Only Look Once) ist einer der beliebtesten Deep-Learning-basierten Objekterkennungsalgorithmen. Heute werden wir sehen, wie wir unseren eigenen Objektdetektor mit der neuesten YOLO-Variante YOLOv5 trainieren können.
Wir verwenden ein Straßenschild-Dataset.
Das erste, was Sie tun müssen, ist, das Repository von YOLOv5 GitHub zu klonen und seine Anforderungen herunterzuladen ( für einige Abhängigkeiten müssen Sie möglicherweise sudo ausführen ).
Geben Sie im Terminal Folgendes ein:
git clone https://github.com/ultralytics/yolov5
Wenn Sie YOLOv5 in einer neuen Umgebung ausführen möchten, ist dies der richtige Moment, um eine zu erstellen.
Nach der Aktivierung müssen Sie im nächsten Schritt die erforderlichen Abhängigkeiten installieren.
pip install -r yolov5/requirements.txt
Um die Einrichtung abzuschließen, importieren wir nach der Installation der Anforderungen die Module, die wir verwenden werden.
import torch
from IPython.display import Image # for displaying images
import os
import random
import shutil
from sklearn.model_selection import train_test_split
import xml.etree.ElementTree as ET
from xml.dom import minidom
from tqdm import tqdm
from PIL import Image, ImageDraw
import numpy as np
import matplotlib.pyplot as plt
random.seed(42)
Wir verwenden ein Dataset zur Erkennung von Verkehrszeichen von MakeML, das Sie hier finden können .
Wir haben hauptsächlich vier Klassen: Ampel, Haltestelle, Tempolimit und Zebrastreifen.
Wir verwenden einen relativ kleinen Datensatz (idealerweise möchten Sie einen größeren, um die YOLO-Funktionen voll auszuschöpfen), dies dient dem schnellen Modell-Prototyping, sodass der Trainingsprozess nicht viel Zeit in Anspruch nimmt und Sie problemlos mit verschiedenen Hyperparametern experimentieren können und Konfigurationen.
Der nächste Schritt besteht darin, einen Ordner für unseren Datensatz zu erstellen:
mkdir road_sign_dataset
cd road_sign_dataset
Laden Sie als Nächstes den Datensatz herunter:
wget -O RoadSignDetectionDataset.zip https://arcraftimages.s3-accelerate.amazonaws.com/Datasets/RoadSigns/RoadSignsPascalVOC.zip?region=us-east-2
Und entpacken Sie es.
unzip RoadSignDetectionDataset.zip
Nachdem wir den Datensatz heruntergeladen haben, müssen wir die Anmerkungen in ein von YOLO akzeptiertes Format konvertieren.
Für unseren Datensatz ist das Annotationsformat PASCAL VOC XML, das sehr beliebt ist. Das bedeutet, dass Sie leicht Online-Tools zum Konvertieren des Anmerkungsformats finden können.
YOLO v5 erwartet für jedes Bild Anmerkungen in Form einer .txt
Datei, wobei jede Zeile der Textdatei einen Begrenzungsrahmen beschreibt, wie im Bild:
Es ist eine Zeile pro Objekt mit diesen Spezifikationen:
class
x_center
y_center
width
height
Format.Wir werden jetzt eine Funktion schreiben, die Informationen aus der VOC-Datei extrahiert und in einem Wörterbuch speichert.
# Function to get the data from XML Annotation
def extract_info_from_xml(xml_file):
root = ET.parse(xml_file).getroot()
# Initialise the info dict
info_dict = {}
info_dict['bboxes'] = []
# Parse the XML
for elem in root:
# Get the file name
if elem.tag == "filename":
info_dict['filename'] = elem.text
# Get the image size
elif elem.tag == "size":
image_size = []
for subelem in elem:
image_size.append(int(subelem.text))
info_dict['image_size'] = tuple(image_size)
# Get details of the bounding box
elif elem.tag == "object":
bbox = {}
for subelem in elem:
if subelem.tag == "name":
bbox["class"] = subelem.text
elif subelem.tag == "bndbox":
for subsubelem in subelem:
bbox[subsubelem.tag] = int(subsubelem.text)
info_dict['bboxes'].append(bbox)
return info_dict
Fühlen Sie sich frei, es an einer Anmerkungsdatei zu testen.
Wir müssen nun die in diesem Wörterbuch gespeicherten Informationen in Annotationen im YOLO v5-Stil umwandeln und in eine txt
Datei schreiben . Wenn Sie einen anderen Datensatz gewählt haben und ein anderes Anmerkungsformat haben, müssen Sie die Funktion an Ihr eigenes Format anpassen.
# Dictionary that maps class names to IDs
class_name_to_id_mapping = {"trafficlight": 0,
"stop": 1,
"speedlimit": 2,
"crosswalk": 3}
# Convert the info dict to the required yolo format and write it to disk
def convert_to_yolov5(info_dict):
print_buffer = []
# For each bounding box
for b in info_dict["bboxes"]:
try:
class_id = class_name_to_id_mapping[b["class"]]
except KeyError:
print("Invalid Class. Must be one from ", class_name_to_id_mapping.keys())
# Transform the bbox co-ordinates as per the format required by YOLO v5
b_center_x = (b["xmin"] + b["xmax"]) / 2
b_center_y = (b["ymin"] + b["ymax"]) / 2
b_width = (b["xmax"] - b["xmin"])
b_height = (b["ymax"] - b["ymin"])
# Normalise the co-ordinates by the dimensions of the image
image_w, image_h, image_c = info_dict["image_size"]
b_center_x /= image_w
b_center_y /= image_h
b_width /= image_w
b_height /= image_h
#Write the bbox details to the file
print_buffer.append("{} {:.3f} {:.3f} {:.3f} {:.3f}".format(class_id, b_center_x, b_center_y, b_width, b_height))
# Name of the file which we have to save
save_file_name = os.path.join("annotations", info_dict["filename"].replace("png", "txt"))
# Save the annotation to disk
print("\n".join(print_buffer), file= open(save_file_name, "w"))
Schließlich konvertieren wir alle xml
Anmerkungen in txt
solche im YOLO-Stil .
# Get the annotations
annotations = [os.path.join('annotations', x) for x in os.listdir('annotations') if x[-3:] == "xml"]
annotations.sort()
# Convert and save the annotations
for ann in tqdm(annotations):
info_dict = extract_info_from_xml(ann)
convert_to_yolov5(info_dict)
annotations = [os.path.join('annotations', x) for x in os.listdir('annotations') if x[-3:] == "txt"]
Beachten Sie, dass wenn das von Ihnen gewählte Dataset keine Anmerkungen enthält, Sie es nicht umgehen können. Sie müssen dies manuell tun.
Zu Ihrem Glück bietet das Internet verschiedene Lösungen für die manuelle Kennzeichnung Ihres Datensatzes:
Auch wenn Sie auf einen Datensatz mit YOLO-kompatiblen Anmerkungen stoßen, brauchen Sie diesen ganzen Durcheinander nicht, Sie können im Grunde genommen zum Schulungskapitel springen.
Wie immer ist es sehr wichtig, Ihren Datensatz in Trainings-, Validierungs- und Testordner aufzuteilen. Wir werden einen Ansatz von 80%, 10%, 10% durchführen, aber Sie können ihn gerne ändern!
# Read images and annotations
images = [os.path.join('images', x) for x in os.listdir('images')]
annotations = [os.path.join('annotations', x) for x in os.listdir('annotations') if x[-3:] == "txt"]
images.sort()
annotations.sort()
# Split the dataset into train-valid-test splits
train_images, val_images, train_annotations, val_annotations = train_test_split(images, annotations, test_size = 0.2, random_state = 42)
val_images, test_images, val_annotations, test_annotations = train_test_split(val_images, val_annotations, test_size = 0.5,
Wir brauchen jetzt Ordner, um die neue Version des Datensatzes zu speichern
!mkdir images/train images/val images/test annotations/train annotations/val annotations/test
Und jetzt verschieben wir die Bilder!
def move_files_to_folder(list_of_files, destination_folder):
for f in list_of_files:
try:
shutil.move(f, destination_folder)
except:
print(f)
assert False
# Move the splits into their folders
move_files_to_folder(train_images, 'images/train')
move_files_to_folder(val_images, 'images/val/')
move_files_to_folder(test_images, 'images/test/')
move_files_to_folder(train_annotations, 'annotations/train/')
move_files_to_folder(val_annotations, 'annotations/val/')
move_files_to_folder(test_annotations, 'annotations/test/')
Benennen Sie den annotations
Ordner in um labels
, da YOLO v5 erwartet, dass sich dort die Anmerkungen befinden.
Da unser Datensatz nun fertig ist, müssen wir unseren benutzerdefinierten Objektdetektor trainieren!
Wir werden das yolov5-Repository selbst verwenden, aber zuerst sehen wir uns die Flags an, die wir verwenden werden.
img
: die Größe des Bildes, es ist ein quadratisches.batch
: die Losgrößeepochs
: Anzahl der Epochendata
: Daten-YAML-Datei, die Informationen zum Datensatz enthält (Pfad der Bilder, Labels)workers
: Anzahl der CPU-Workercfg
: Konfigurationsdatei der Modellarchitektur. Es stehen 4 Auswahlmöglichkeiten zur Verfügung: yolo5s.yaml
, yolov5m.yaml
, yolov5l.yaml
, yolov5x.yaml
. Die Größe und Komplexität dieser Modelle nimmt in aufsteigender Reihenfolge zu und Sie können ein Modell auswählen, das der Komplexität Ihrer Objekterkennungsaufgabe entspricht.weights
: Vortrainierte Gewichte, mit denen Sie mit dem Training beginnen möchten. Wenn Sie von Grund auf neu trainieren möchten, verwenden Sie--weights ' '
name
: verschiedene Dinge über das Training, wie zum Beispiel Zugprotokolle. Trainingsgewichte werden in einem Ordner namens . gespeichertruns/train/name
hyp
: YAML-Datei, die Hyperparameteroptionen beschreibt. Wenn nicht angegeben, wird die Datei data/hyp.scratch.yaml
verwendet.Erstellen Sie eine neue Datei namens road_sign_data.yaml
und legen Sie sie in den yolov5/data
Ordner. Füllen Sie es dann mit folgendem aus.
YOLO v5 erwartet, die Trainingslabels für die Bilder in dem Ordner zu finden, dessen Name durch Ersetzen von „images“ durch „labels“ im Pfad zu den Datensatzbildern abgeleitet werden kann. Im obigen Beispiel sucht YOLO v5 beispielsweise nach Zugbezeichnungen in ../road_sign_dataset/labels/train/
.
Um das Tutorial einfach und kurz zu halten, werden wir uns weder die Hyperparameters-Konfigurationsdatei noch die Architekturdatei ansehen. Bei Bedarf können Sie sie auch optimieren.
Es ist ratsam, mit dem kleinsten Modell zu beginnen, damit wir sehen können, wie es sich mit unserem Datensatz verhält, und es von dort aus skalieren können.
Um den Trainingsprozess zu starten, vergewissern Sie sich, dass Sie sich im Ordner des yolov5-Repositorys befinden, und zwar einfach vom Terminal aus:
python train.py --img 640 --cfg yolov5s.yaml --hyp hyp.scratch.yaml --batch 32 --epochs 100 --data road_sign_data.yaml --weights yolov5s.pt --workers 24 --name yolo_road_det
Sie können es nach Ihren Bedürfnissen ändern. Der Vorgang kann bis zu 30 Minuten dauern, hängt jedoch von Ihrer Hardware ab.
Nun, jetzt haben Sie Ihren eigenen Objektdetektor! Herzlichen Glückwunsch, dass Sie so weit gekommen sind!
Nun, ich glaube, Sie möchten es testen, und es gibt verschiedene Möglichkeiten, dies zu tun, indem Sie die detect.py
Datei verwenden (einzelnes Bild, Ordner, Video, Webcam).
python detect.py --source ../road_sign_dataset/images/test/ --weights runs/train/yolo_road_det/weights/best.pt --conf 0.25 --name yolo_road_det
source
: Definiert die Quelle des Inferenztests, mehr dazu in einer Minute.weights
: „best.pt“ enthält die leistungsstärksten Gewichte, die während des Trainings gespeichert wurden.conf
: Definiert den Schwellenwert für das Vertrauen.name
: wo die Erkennungen gespeichert werden.Außer dem Datensatzordner können Sie andere Eingaben für das Quellkennzeichen verwenden.
Sie sind jetzt fertig! Sie haben Ihren eigenen Objektdetektor!
1598352960
Object detection is a computer vision task that involves predicting the presence of one or more objects, along with their classes and bounding boxes. YOLO (You Only Look Once) is a state of art Object Detector which can perform object detection in real-time with a good accuracy.
The first three YOLO versions have been released in 2016, 2017 and 2018 respectively. However, in 2020, within only a few months of period, three major versions of YOLO have been released named YOLO v4, YOLO v5 and PP-YOLO. The release of YOLO v5 has even made a controversy among the people in machine learning community.
Additionally, this has caused a dilemma in the minds of people who are going to start their machine learning projects. In this article, we will discuss the reason for these many new YOLO releases, while emphasizing their originality, authorship, performance and the major improvements, helping people to choose the most appropriate version for their project.
YOLO has been first introduced in 2016 and it was a milestone in object detection research due to its capability of detecting objects in real-time with a better accuracy.
It was proposed by Joseph Redmon, a graduate from the University of Washington. The paper describing YOLO won the the OpenCV People’s Choice Award at the Conference on Computer Vision and Pattern Recognition (CVPR) in 2016.
#machine-learning #yolo #yolov5 #yolov4 #object-detection #deep learning
1595039460
YOLO (You Only Look Once) is one of the most popular object detector convolutional neural networks (CNNs). After Joseph Redmon et al. published their first YOLO paper in 2015, subsequent versions were published by them in 2016, 2017 and by Alexey Bochkovskiy in 2020. This article is the first in a series of articles that provide an overview of how the YOLO CNN has evolved from the first version to the latest version.
Before the invention of YOLO, object detector CNNs such R-CNN used Region Proposal Networks (RPNs) first to generate bounding box proposals on the input image, then run a classifier on the bounding boxes and finally apply post-processing to eliminate duplicate detections as well as refine the bounding boxes. Individual stages of the R-CNN network had to be trained separately. R-CNN network was hard to optimize as well as slow.
Creators of YOLO were motivated to design a single stage CNN that could be trained end to end, was easy to optimize and was real-time.
Figure 1: YOLO version 1 conceptual design
As shown in figure 1 left image, YOLO divides the input image into S x S grid cells. As show in figure 1 middle top image, each grid cell predicts B bounding boxes and an “objectness” score P(Object) indicating whether the grid cell contains an object or not. As shown in figure 1 middle bottom image, each grid cell also predicts the conditional probability P(Class | Object) of the class the object contained by the grid cell belongs to.
For each bounding box, YOLO predicts five parameters — _x, y, w, h _and a confidence score. The center of the bounding box with respect to the grid cell is denoted by the coordinates (x,y). The values of _x _and _y _are bounded between 0 and 1. The width _w _and height _h _of the bounding box are predicted as a fraction of the width and height of the whole image. So their values are between 0 and 1. The confidence score indicates whether the bounding box has an object and how accurate the bounding box is. If the bounding box does not have an object, then the confidence score is zero. If the bounding box has an object, then the confidence score equals Intersection Over Union (IoU) of the predicted bounding box and the ground truth. Thus for each grid cell, YOLO predicts B x 5 parameters.
For each grid cell, YOLO predicts C class probabilities. These class probabilities are conditional based on an object existing in the grid cell. YOLO only predicts one set of C class probabilities per grid cell even though the grid cell has B bounding boxes. Thus for each grid cell, YOLO predicts C + B x 5 parameters.
Total prediction tensor for an image = S x S x (C + B x 5). For PASCAL VOC dataset, YOLO uses S = 7, B = 2 and C = 20. Thus final YOLO prediction for PASCAL VOC is a 7 x 7 x (20 + 5 x 2) = 7 x 7 x 30 tensor.
Finally, YOLO version 1 applies Non Maximum Suppression (NMS) and thresholding to report final predictions as show in figure 1 right image.
#yolo #machine-learning #deep-learning #computer-vision #object-detection #deep learning
1625730346
In this article, we’ll discuss information about the YOLOrekt project and YOLO token
A social, hyper-gamified approach to short-term prediction markets. Provide in-game liquidity or predict the future price of ETH and other crypto assets. YOLOrekt is building a comprehensive short-term prediction platform for crypto, stocks, and more. YOLO is a social and fun way to bid on the future price of an asset. Provide in-game liquidity to earn game fees and YOLO rewards.
“YOLOrekt was designed to cater to a short attention span and for options traders who don’t have to own the asset or buy an option to predict where the price is heading within the next few minutes,” says YOLOrekt Founder Yogesh Srihari.
For those who don’t remember or are new to the game: YOLOrekt’s players bid on the price of a specific asset such as Ethereum, predicting whether the price will be above or below a specific strike price in the next 3 minutes. As part of the upcoming re-launch of the platform, YOLOrekt plans to issue a YOLO token that enables decentralized liquidity, thereby incentivizing liquidity providers to turn a profit (via a fee) on each game while contributing to the global liquidity pool.
In each game, a portion of the liquidity from YOLOrekt’s liquidity pool will be drawn and placed as bids to balance bid amounts on each side against the incoming users’ bids. The size of the LP pool grows or shrinks based on a few factors:
For the first time in crypto history, YOLOrekt is doing a synced dual-token issuance simultaneously on Ethereum and Polygon. The YOLO token issuance aims to raise capital for bootstrapping liquidity by issuing 5% of the YOLO tokens. The majority of the remaining YOLO tokens will be issued as rewards over three years to incentivize in-game liquidity.
A multi-issuance token employs a relatively novel approach of running token issuance on multiple blockchain platforms concurrently, allowing users to buy tokens on either platform. At the end of the token issuance, coordination logic will be invoked to calculate the actual price per token based on the contributions across both blockchain platforms.
YOLO Token Issuance App
Introduction to Dual Token Issuance
Dual issuance comprises of smart contracts running on both blockchain platforms simultaneously, i.e., Ethereum and Polygon.
The issuance contracts, simply stated, accept contributions until the end of the token issuance period and then proportionally distribute the combined 5% issuance amount between all the contributors on both chains.
Issuance leverages Polygon’s FX-portal state sync mechanism for passing total contribution sum from child to root (cross-chain Polygon to Ethereum) via proof validation of checkpointed message data stored on Ethereum by Polygon validators. Once the Ethereum contract is aware of the mETH sum, it can divide up the token to migrate the necessary portion of 5% YOLO issuance to the Polygon (Matic) network. Subsequently, the Polygon proof of stake (POS) token bridge is used for locking tokens on the Ethereum chain for one-to-one transfer onto the Polygon chain.
Once the platform is ready to go live, or following 60 days after issuance close-whichever comes first-the redemption regime can be initiated. All contributors can withdraw their portion of the YOLO tokens from the issuance contract.
Post-Token Issuance
Up to 15% of contributed funds will be encumbered for the project budget. The remainder of contributed funds will be deposited along with the YOLO token into decentralized AMMs (likely SushiSwap) to bootstrap liquidity. The pair deposit ratio is based on the total contribution ratio of ETH and mETH on both Ethereum and Polygon to total tokens issued during the issuance campaign (5% of total or 50 million YOLO). As such, no less than 4.25% of the fresh tokens will be deposited along with contributed funds into AMMs to provide liquidity on the open market. The aforementioned occurs immediately before opening up the redemption window when contributors can redeem their token share.
Liquidity Pools
Liquidity on YOLOrekt is provided by decentralized in-game LP pools that liquidity providers back. To enable decentralized liquidity provider (LP) pools, YOLOrekt utilizes a token called YOLO token. The mechanism solves issues revolving around in-game liquidity and incentivizes liquidity providers with fees per game distributed back to the pool. In addition, LPs can stake YOLO tokens directly used in the game liquidity pool.
YOLO Token Holders
Depositing YOLO tokens into the platform provides in-game liquidity through participation in YOLO LP Pool, capturing fees generated from the games. Fees of 3% or more are deducted from the payout of each game. More details on the design and mechanism of YOLO tokens will be disclosed in upcoming articles.
How to Participate
Audits and issuance contract mechanics
Two independent auditing teams are performing the YOLO issuance contracts security audits:
Audits will be undertaken on two major contracts and several already well-audited and battle-tested contracts by Polygon and OpenZeppelin. The two major contracts are:
Interaction between IssuanceEthereum and IssuancePolygon happens through the following:
Sequence Diagram
The diagram depicts the three significant interactions.
We hope you enjoyed our rundown of the novel YOLO dual-token issuance. Stay tuned for our upcoming lite paper and further technical releases.
You will have to first buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
We will use Binance Exchange here as it is one of the largest crypto exchanges that accept fiat deposits.
Binance is a popular cryptocurrency exchange which was started in China but then moved their headquarters to the crypto-friendly Island of Malta in the EU. Binance is popular for its crypto to crypto exchange services. Binance exploded onto the scene in the mania of 2017 and has since gone on to become the top crypto exchange in the world.
Once you finished the KYC process. You will be asked to add a payment method. Here you can either choose to provide a credit/debit card or use a bank transfer, and buy one of the major cryptocurrencies, usually either Bitcoin (BTC), Ethereum (ETH), Tether (USDT), Binance (BNB)…
Step by Step Guide : What is Binance | How to Create an account on Binance (Updated 2021)
Next step - Transfer your cryptos to an Altcoin Exchange
Once finished you will then need to make a BTC/ETH/USDT/BNB deposit to the exchange from Binance depending on the available market pairs. After the deposit is confirmed you may then purchase YOLO from the website: https://yolorekt.finance.
The top exchange for trading in YOLO token is currently …
Find more information YOLO
☞ Website ☞ Social Channel ☞ Social Channel 2 ☞ Message Board
🔺DISCLAIMER: The Information in the post isn’t financial advice, is intended FOR GENERAL INFORMATION PURPOSES ONLY. Trading Cryptocurrency is VERY risky. Make sure you understand these risks and that you are responsible for what you do with your money.
🔥 If you’re a beginner. I believe the article below will be useful to you ☞ What You Should Know Before Investing in Cryptocurrency - For Beginner
⭐ ⭐ ⭐The project is of interest to the community. Join to Get free ‘GEEK coin’ (GEEKCASH coin)!
☞ **-----https://geekcash.org-----**⭐ ⭐ ⭐
Thank for visiting and reading this article! Please don’t forget to leave a like, comment and share!
#blockchain #bitcoin #yolo #yolorekt
1610011730
YOLO or You Only Look Once, is a popular real-time object detection algorithm. YOLO combines what was once a multi-step process, using a single neural network to perform both classification and prediction of bounding boxes for detected objects. As such, it is heavily optimized for detection performance and can run much faster than running two separate neural networks to detect and classify objects separately. It does this by repurposing traditional image classifiers to be used for the regression task of identifying bounding boxes for objects. This article will only look at YOLOv1, the first of the many iterations this architecture has gone through. Although the subsequent iterations feature numerous improvements, the basic idea behind the architecture stays the same. YOLOv1 referred to as just YOLO, can perform faster than real-time object detection at 45 frames per second, making it a great choice for applications that require real-time detection. It looks at the entire image at once, and only once — hence the name You Only Look Once — which allows it to capture the context of detected objects. This halves the number of false-positive detections it makes over R-CNNs which look at different parts of the image separately. Additionally, YOLO can generalize the representations of various objects, making it more applicable to a variety of new environments. Now that we have a general overview of YOLO, let’s take a look at how it really works.
#yolo #machine-learning #deep-learning #programming #developer