Initialization
Parameters
TheClassificationAgent
is initialized with two arguments:
Specifies the list of class labels that will be used for the image classification task.Each object of interest (or βclassβ) should be described textually within the
classes
list.Represents the model used to perform the image segmentation task and takes an instance of
ClassificationModel
. If left unspecified, this parameter defaults to the CLIP()
Model.The supported ClassificationModel
models can be found below:Note: Since a text embedding of each class will be used to when classifying the image, a more specific class name will yield a more specific detection. You should scope your class names accordingly. For instance, a"car"
class will result in more general detections than a"blue Honda Accord"
class.
Example
example.py