To extend the vision.CascadeObjectDetector
class and override the set.ClassificationModel
method, you can create a new class that inherits from the vision.CascadeObjectDetector
class and reimplement the set.ClassificationModel
method. Here is an example implementation:
main.m350 chars15 lines
In this example, the MyCascadeObjectDetector
class extends the vision.CascadeObjectDetector
class and overrides the set.ClassificationModel
method. The new implementation validates that the input classification model is of a class called myClassificationModel
and sets the ClassificationModel
property to the input value.
You can now create an instance of the MyCascadeObjectDetector
class and use it like the original vision.CascadeObjectDetector
class:
main.m84 chars4 lines
Where myModel
is an instance of the myClassificationModel
class.
gistlibby LogSnag