the models in devolearn have different architectures, and different purposes. But it would be great if all of the models come under one single base class like:
class InferenceEngine():
def __init__self(model, checkpoint, preprocess, deprocess, device = 'cuda'):
self.model = model
self.model.load_state_dict(torch.load(checkpoint))
self.model.to(device)
def inference(self, x):
x = self.preprocess(x)
pred = self.model(x)
return self.deprocess(pred)
...other methods...
def __repr__(self):
return self.model
the models in devolearn have different architectures, and different purposes. But it would be great if all of the models come under one single base class like: