__init__.py 1.59 KB
Newer Older
1
from extractor import Extractor
2
from feature_extraction import FeatureExtractor
3
from color_summarizer import ColorStats
4
from glcm import GLCM
5 6 7 8 9 10
from hog import HOG
from image_moments import ImageMoments
from lbp import LBP

__all__ = ["extractor",
            "color_summarizer",
11
            "glcm",
12 13 14 15 16 17 18 19 20 21 22 23
            "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),
24
                            "glcm" : Config("Gray-Level Co-Occurrence Matrix", True, bool, meta=GLCM),
25 26 27 28 29 30 31 32 33
                            "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"])
34
        _extractor_list["glcm"] = Config.nvl_config(configs["glcm"], _extractor_list["glcm"])
35 36 37
        _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"])