class PetClassification(BentoService): @api(input=FastaiImageInput()) def predict(self, image): fastai_image = pil2tensor(image, np.float32) fastai_image = Image(fastai_image) result = self.artifacts.pet_classifer.predict(fastai_image) return str(result)
class TestFastAiImageService(bentoml.BentoService): @bentoml.api(input=FastaiImageInput()) def test(self, image): return image
class ImageInputModelForFastai(bentoml.BentoService): @bentoml.api(input=FastaiImageInput()) def predict(self, image): return list(image.shape)
class PetClassification(BentoService): @api(input=FastaiImageInput()) def predict(self, image): result = self.artifacts.pet_classifer.predict(image) return str(result)