YOLO V8 Classify Trained on ImageNet Competition Data

Identify the main object in an image

YOLO (You Only Look Once) Version 8 by Ultralytics is the latest version of the YOLO models. Just like its predecessor, YOLO Version 5, YOLO Version 8 is an anchor-free model that was trained with mosaic augmentation. It features the use of new "C2f" blocks, which employ additional dense connections between bottleneck modules. Although YOLO models are historically object detection models, in this case, their heads were adapted for image classification and the models were trained on ImageNet.

Training Set Information

Model Information

Examples

Resource retrieval

Get the pre-trained net:

In[1]:=
NetModel["YOLO V8 Classify Trained on ImageNet Competition Data"]
Out[2]=

NetModel parameters

This model consists of a family of individual nets, each identified by a specific parameter combination. Inspect the available parameters:

In[3]:=
NetModel["YOLO V8 Classify Trained on ImageNet Competition Data", "ParametersInformation"]
Out[4]=

Pick a non-default net by specifying the parameters:

In[5]:=
NetModel[{"YOLO V8 Classify Trained on ImageNet Competition Data", "Size" -> "X"}]
Out[6]=

Pick a non-default uninitialized net:

In[7]:=
NetModel[{"YOLO V8 Classify Trained on ImageNet Competition Data", "Size" -> "M"}, "UninitializedEvaluationNet"]
Out[8]=

Basic usage

Classify an image:

In[9]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/fb779ef2-8026-41a2-844d-f8b54ad9eedd"]
In[10]:=
pred = NetModel[
   "YOLO V8 Classify Trained on ImageNet Competition Data"][testImage]
Out[11]=

The prediction is an Entity object, which can be queried:

In[12]:=
pred["Definition"]
Out[12]=

Get a list of available properties of the predicted Entity:

In[13]:=
pred["Properties"]
Out[13]=

Obtain the probabilities of the 10 most likely entities predicted by the net:

In[14]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/d3f275ad-e60d-46e8-a15c-198390779830"]
Out[15]=

An object outside the list of the ImageNet classes will be misidentified:

In[16]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/6c04f2a3-c69d-4bca-82f5-a2ad1063394f"]
Out[17]=

Obtain the list of names of all available classes:

In[18]:=
EntityValue[
 NetExtract[
   NetModel["YOLO V8 Classify Trained on ImageNet Competition Data"], "Output"][["Labels"]], "Name"]
Out[19]=

Resource History

Reference