removing unused code / refactoring for coverage maximization
This commit is contained in:
parent
a95cc4e06b
commit
ce3d33955e
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -2,5 +2,7 @@ import abc
|
||||
|
||||
|
||||
class Formatter(abc.ABC):
|
||||
|
||||
@abc.abstractmethod
|
||||
def format(self, info: dict):
|
||||
pass
|
||||
raise NotImplementedError
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user