23 lines
781 B
Python

from image_prediction.estimator.adapter.adapter import EstimatorAdapter
from image_prediction.estimator.estimator import Estimator
class EstimatorAdapterPatch(EstimatorAdapter):
def __init__(self, estimator: Estimator):
super().__init__(estimator=estimator)
self.__output_batch = None
@property
def output_batch(self):
return self.__output_batch
@output_batch.setter
def output_batch(self, output_batch):
self.__output_batch = output_batch
def predict(self, batch):
# Call the internal estimator, so mechanical issues would surface
self.estimator.predict(batch)
# but discard the returned values for the purposes of testing the interface that calls the adapter
return self.__output_batch