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):
|
class Preprocessor(abc.ABC):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def preprocess(batch):
|
def preprocess(batch):
|
||||||
pass
|
raise NotImplementedError
|
||||||
|
|
||||||
def __call__(self, batch):
|
def __call__(self, batch):
|
||||||
return self.preprocess(batch)
|
return self.preprocess(batch)
|
||||||
|
|||||||
@ -8,6 +8,3 @@ class BasicPreprocessor(Preprocessor):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def preprocess(images):
|
def preprocess(images):
|
||||||
return images_to_batch_tensor(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
|
self.extractor = image_extractor
|
||||||
|
|
||||||
def __process_batch(self, batch):
|
def __process_batch(self, batch):
|
||||||
try:
|
images, metadata = zip(*batch)
|
||||||
images, metadata = zip(*batch)
|
|
||||||
except ValueError:
|
|
||||||
return []
|
|
||||||
|
|
||||||
predictions = self.classifier(images)
|
predictions = self.classifier(images)
|
||||||
responses = ({"prediction": prd, **mdt} for prd, mdt in zip(predictions, metadata))
|
responses = ({"prediction": prd, **mdt} for prd, mdt in zip(predictions, metadata))
|
||||||
|
|||||||
@ -2,5 +2,7 @@ import abc
|
|||||||
|
|
||||||
|
|
||||||
class Formatter(abc.ABC):
|
class Formatter(abc.ABC):
|
||||||
|
|
||||||
|
@abc.abstractmethod
|
||||||
def format(self, info: dict):
|
def format(self, info: dict):
|
||||||
pass
|
raise NotImplementedError
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user