def detect(self, img_data):
    if img_data:
        data_block_iterable = ImageDataBlockRequestIterable(img_data)
        try:
            response = self.stub.detect(data_block_iterable)
            return response
        except grpc.RpcError as err:
            print(err.details())
    else:
        print('image data is none.')
def detect(self, img_data):
    if img_data:
        data_block_iterable = ImageDataBlockRequestIterable(img_data)
        try:
            response = self.stub.detect(data_block_iterable)
            return response
        except grpc.RpcError as err:
            print(err.details())
    else:
        print('image data is none.')