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