When define the data processing flow in the segmenter base class, the code requires the detector and the tracker instance to have some APIs. An example is the commonly used process() method and the getState() method required for the tracker class from those lines:
if self.tracker is not None:
self.tracker.process(self.layer_mask)
self.layer_state = self.tracker.getstate()
When having these requirements, I think it would be better to have some sanity check. I add that for the detector by making sure the detector is an instance of a base detector class that contains the methods wanted as below (from those lines )
from detector.inImage import inImage
if theDetector is not None:
# to make sure the detector has the desired API
assert isinstance(theDetector, inImage)
But for the tracker I found no such base class from the trackerpointer repo. Also as we may use trackers other than the trackpointers? So not sure how to do the sanity check.
Functional for the current use. But leave that issue for the future improvement
When define the data processing flow in the segmenter base class, the code requires the detector and the tracker instance to have some APIs. An example is the commonly used
process()
method and thegetState()
method required for the tracker class from those lines:When having these requirements, I think it would be better to have some sanity check. I add that for the detector by making sure the detector is an instance of a base detector class that contains the methods wanted as below (from those lines )
But for the tracker I found no such base class from the trackerpointer repo. Also as we may use trackers other than the trackpointers? So not sure how to do the sanity check.
Functional for the current use. But leave that issue for the future improvement