13 lines
459 B
Python
13 lines
459 B
Python
from typing import Mapping, List
|
|
|
|
from image_prediction.estimator.adapter.adapter import EstimatorAdapter
|
|
|
|
|
|
class ServiceEstimator:
|
|
def __init__(self, estimator_adapter: EstimatorAdapter, classes: Mapping[int, str]):
|
|
self.__estimator_adapter = estimator_adapter
|
|
self.__classes = classes
|
|
|
|
def predict(self, batch) -> List[str]:
|
|
return [self.__classes[numeric_label] for numeric_label in self.__estimator_adapter.predict(batch)]
|