Exemplo n.º 1
0
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)
Exemplo n.º 2
0
 class TestFastAiImageService(bentoml.BentoService):
     @bentoml.api(input=FastaiImageInput())
     def test(self, image):
         return image
Exemplo n.º 3
0
 class ImageInputModelForFastai(bentoml.BentoService):
     @bentoml.api(input=FastaiImageInput())
     def predict(self, image):
         return list(image.shape)
Exemplo n.º 4
0
class PetClassification(BentoService):
    
    @api(input=FastaiImageInput())
    def predict(self, image):
        result = self.artifacts.pet_classifer.predict(image)
        return str(result)