Abstract class to detect objects in an image.
This class allows to analyze an image in order to detect objects. It stores a list of sppasCoords() for each detected object. The detected object corresponds to the one of the trained model (human face, human profile, cat face, car...).
Example
Example
>>> f = BaseObjectsDetector()
>>> f.load_model(model_filename)
>>> # Detect all the objects in an image
>>> f.detect(sppasImage(filename="image path"))
>>> # Get number of detected objects
>>> len(f)
>>> # Browse through the detected object coordinates:
>>> for c in f:
>>> print(c)
An object detector is instantiated from a model. It will be used to detect the objects matching the model in an image. Detected objects are stored in a list of coordinates. The confidence score of each detected object is expected to range [0., 1.].
Two filters are used to filter detected objects: - a min confidence score; - a min ratio between the object (w,h) related to the ones of the image.