def __next__(self):
    data_block = self.data[self.pos:(self.pos + BLOCK_SIZE)]
    if data_block:
        request = object_detection_pb2.UploadImageRequest(data_block=data_block)
        self.pos += BLOCK_SIZE
        return request
    else:
        raise StopIteration
def __next__(self):
    data_block = self.data[self.pos:(self.pos + BLOCK_SIZE)]
    if data_block:
        request = object_detection_pb2.UploadImageRequest(data_block=data_block)
        self.pos += BLOCK_SIZE
        return request
    else:
        raise StopIteration