__init__.py 477 字节
Newer Older
W
weishengyu 已提交
1 2
from abc import ABC, abstractmethod

W
weishengyu 已提交
3
from processor.algo_mod import predictors, searcher
W
weishengyu 已提交
4 5 6 7


def build_processor(config):
    processor_type = config.get("processor_type")
W
weishengyu 已提交
8 9 10
    processor_mod = locals()[processor_type]
    processor_name = config.get("processor_name")
    return getattr(processor_mod, processor_name)
W
weishengyu 已提交
11 12 13 14 15 16 17 18 19 20


class BaseProcessor(ABC):
    @abstractmethod
    def __init__(self, config):
        pass

    @abstractmethod
    def process(self, input_data):
        pass