__init__.py 1.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
from extractor import Extractor
from color_summarizer import ColorStats
from hog import HOG
from image_moments import ImageMoments
from lbp import LBP

__all__ = ["extractor",
            "color_summarizer",
            "hog",
            "image_moments",
            "lbp"]


from collections import OrderedDict
from util.config import Config


_extractor_list = OrderedDict( { 
                            "color_summarizer" : Config("Color Statistics", True, bool, meta=ColorStats),
                            "hog" : Config("Histogram of Oriented Gradients", True, bool, meta=HOG),
                            "image_moments" : Config("Image Moments (Hu)", True, bool, meta=ImageMoments),
                            "lbp" : Config("Local Binary Patterns", True, bool, meta=LBP)
                        } )

def get_extractor_config():
    return _extractor_list

def set_extractor_config(configs):
        _extractor_list["color_summarizer"] = Config.nvl_config(configs["color_summarizer"], _extractor_list["color_summarizer"])
        _extractor_list["hog"] = Config.nvl_config(configs["hog"], _extractor_list["hog"])
        _extractor_list["image_moments"] = Config.nvl_config(configs["image_moments"], _extractor_list["image_moments"])
        _extractor_list["lbp"] = Config.nvl_config(configs["lbp"], _extractor_list["lbp"])