mlpc-lab/BLIVA
9
1"""2 Copyright (c) 2022, salesforce.com, inc.3 All rights reserved.4 SPDX-License-Identifier: BSD-3-Clause5 For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause6"""7 8from omegaconf import OmegaConf9 10 11class BaseProcessor:12 def __init__(self):13 self.transform = lambda x: x14 return15 16 def __call__(self, item):17 return self.transform(item)18 19 @classmethod20 def from_config(cls, cfg=None):21 return cls()22 23 def build(self, **kwargs):24 cfg = OmegaConf.create(kwargs)25 26 return self.from_config(cfg)27 