removing unused code / refactoring for coverage maximization

This commit is contained in:
Matthias Bisping 2022-03-30 18:03:21 +02:00
parent a95cc4e06b
commit ce3d33955e
4 changed files with 6 additions and 9 deletions

View File

@ -2,10 +2,11 @@ import abc
class Preprocessor(abc.ABC):
@staticmethod
@abc.abstractmethod
def preprocess(batch):
pass
raise NotImplementedError
def __call__(self, batch):
return self.preprocess(batch)

View File

@ -8,6 +8,3 @@ class BasicPreprocessor(Preprocessor):
@staticmethod
def preprocess(images):
return images_to_batch_tensor(images)
def __call__(self, images):
return self.preprocess(images)

View File

@ -15,10 +15,7 @@ class ExtractorClassifier:
self.extractor = image_extractor
def __process_batch(self, batch):
try:
images, metadata = zip(*batch)
except ValueError:
return []
images, metadata = zip(*batch)
predictions = self.classifier(images)
responses = ({"prediction": prd, **mdt} for prd, mdt in zip(predictions, metadata))

View File

@ -2,5 +2,7 @@ import abc
class Formatter(abc.ABC):
@abc.abstractmethod
def format(self, info: dict):
pass
raise NotImplementedError