當前位置: 首頁>>代碼示例>>Python>>正文


Python DescriptorElementFactory.get_default_config方法代碼示例

本文整理匯總了Python中smqtk.representation.DescriptorElementFactory.get_default_config方法的典型用法代碼示例。如果您正苦於以下問題:Python DescriptorElementFactory.get_default_config方法的具體用法?Python DescriptorElementFactory.get_default_config怎麽用?Python DescriptorElementFactory.get_default_config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在smqtk.representation.DescriptorElementFactory的用法示例。


在下文中一共展示了DescriptorElementFactory.get_default_config方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_default_config

# 需要導入模塊: from smqtk.representation import DescriptorElementFactory [as 別名]
# 或者: from smqtk.representation.DescriptorElementFactory import get_default_config [as 別名]
    def get_default_config(cls):
        d = super(IqrSearch, cls).get_default_config()

        # Remove parent_app slot for later explicit specification.
        del d['parent_app']

        # fill in plugin configs
        d['data_set'] = plugin.make_config(get_data_set_impls())

        d['descr_generator'] = \
            plugin.make_config(get_descriptor_generator_impls())

        d['nn_index'] = plugin.make_config(get_nn_index_impls())

        ri_config = plugin.make_config(get_relevancy_index_impls())
        if d['rel_index_config']:
            ri_config.update(d['rel_index_config'])
        d['rel_index_config'] = ri_config

        df_config = DescriptorElementFactory.get_default_config()
        if d['descriptor_factory']:
            df_config.update(d['descriptor_factory'].get_config())
        d['descriptor_factory'] = df_config

        return d
開發者ID:dhandeo,項目名稱:SMQTK,代碼行數:27,代碼來源:iqr_search.py

示例2: get_default_config

# 需要導入模塊: from smqtk.representation import DescriptorElementFactory [as 別名]
# 或者: from smqtk.representation.DescriptorElementFactory import get_default_config [as 別名]
    def get_default_config(cls):
        c = super(SmqtkClassifierService, cls).get_default_config()

        c[cls.CONFIG_ENABLE_CLASSIFIER_REMOVAL] = False

        # Static classifier configurations
        c[cls.CONFIG_CLASSIFIER_COLLECTION] = \
            ClassifierCollection.get_default_config()
        # Classification element factory for new classification results.
        c[cls.CONFIG_CLASSIFICATION_FACTORY] = \
            ClassificationElementFactory.get_default_config()
        # Descriptor generator for new content
        c[cls.CONFIG_DESCRIPTOR_GENERATOR] = smqtk.utils.plugin.make_config(
            get_descriptor_generator_impls()
        )
        # Descriptor factory for new content descriptors
        c[cls.CONFIG_DESCRIPTOR_FACTORY] = \
            DescriptorElementFactory.get_default_config()
        # from-IQR-state *supervised* classifier configuration
        c[cls.CONFIG_IQR_CLASSIFIER] = smqtk.utils.plugin.make_config(
            get_classifier_impls(
                sub_interface=SupervisedClassifier
            )
        )
        c[cls.CONFIG_IMMUTABLE_LABELS] = []

        return c
開發者ID:Kitware,項目名稱:SMQTK,代碼行數:29,代碼來源:classifier_server.py

示例3: default_config

# 需要導入模塊: from smqtk.representation import DescriptorElementFactory [as 別名]
# 或者: from smqtk.representation.DescriptorElementFactory import get_default_config [as 別名]
def default_config():
    return {
        "descriptor_generator":
            plugin.make_config(get_descriptor_generator_impls()),
        "descriptor_factory": DescriptorElementFactory.get_default_config(),
        "descriptor_index":
            plugin.make_config(get_descriptor_index_impls())
    }
開發者ID:dhandeo,項目名稱:SMQTK,代碼行數:10,代碼來源:compute_many_descriptors.py

示例4: get_default_config

# 需要導入模塊: from smqtk.representation import DescriptorElementFactory [as 別名]
# 或者: from smqtk.representation.DescriptorElementFactory import get_default_config [as 別名]
def get_default_config():
    return {
        "descriptor_factory":
            DescriptorElementFactory.get_default_config(),
        "descriptor_generator":
            plugin.make_config(get_descriptor_generator_impls()),
        "classification_factory":
            ClassificationElementFactory.get_default_config(),
        "classifier":
            plugin.make_config(get_classifier_impls()),
    }
開發者ID:Kitware,項目名稱:SMQTK,代碼行數:13,代碼來源:classifyFiles.py

示例5: test_configuration

# 需要導入模塊: from smqtk.representation import DescriptorElementFactory [as 別名]
# 或者: from smqtk.representation.DescriptorElementFactory import get_default_config [as 別名]
    def test_configuration(self):
        c = DescriptorElementFactory.get_default_config()
        self.assertIsNone(c['type'])
        self.assertIn('DescriptorMemoryElement', c)

        c['type'] = 'DescriptorMemoryElement'
        factory = DescriptorElementFactory.from_config(c)
        self.assertEqual(factory._d_type.__name__,
                         DescriptorMemoryElement.__name__)
        self.assertEqual(factory._d_type_config, {})

        d = factory.new_descriptor('test', 'foo')
        self.assertEqual(d.type(), 'test')
        self.assertEqual(d.uuid(), 'foo')
開發者ID:Kitware,項目名稱:SMQTK,代碼行數:16,代碼來源:test_DescriptorElementFactory.py

示例6: test_configuration

# 需要導入模塊: from smqtk.representation import DescriptorElementFactory [as 別名]
# 或者: from smqtk.representation.DescriptorElementFactory import get_default_config [as 別名]
    def test_configuration(self):
        c = DescriptorElementFactory.get_default_config()
        ntools.assert_is_none(c['type'])
        ntools.assert_in('DescriptorMemoryElement', c)

        c['type'] = 'DescriptorMemoryElement'
        factory = DescriptorElementFactory.from_config(c)
        ntools.assert_equal(factory._d_type.__name__,
                            DescriptorMemoryElement.__name__)
        ntools.assert_equal(factory._d_type_config, {})

        d = factory.new_descriptor('test', 'foo')
        ntools.assert_equal(d.type(), 'test')
        ntools.assert_equal(d.uuid(), 'foo')
        DescriptorMemoryElement.MEMORY_CACHE = {}
開發者ID:dhandeo,項目名稱:SMQTK,代碼行數:17,代碼來源:test_DescriptorElementFactory.py

示例7: get_default_config

# 需要導入模塊: from smqtk.representation import DescriptorElementFactory [as 別名]
# 或者: from smqtk.representation.DescriptorElementFactory import get_default_config [as 別名]
    def get_default_config(cls):
        """
        Generate and return a default configuration dictionary for this class.
        This will be primarily used for generating what the configuration
        dictionary would look like for this class without instantiating it.

        :return: Default configuration dictionary for the class.
        :rtype: dict

        """
        c = super(DescriptorServiceServer, cls).get_default_config()
        merge_dict(c, {
            "descriptor_factory": DescriptorElementFactory.get_default_config(),
            "descriptor_generators": {
                "example": plugin.make_config(get_descriptor_generator_impls())
            }
        })
        return c
開發者ID:Kitware,項目名稱:SMQTK,代碼行數:20,代碼來源:__init__.py

示例8: default_config

# 需要導入模塊: from smqtk.representation import DescriptorElementFactory [as 別名]
# 或者: from smqtk.representation.DescriptorElementFactory import get_default_config [as 別名]
def default_config():
    return {
        "descriptor_generator": make_config(get_descriptor_generator_impls),
        "descriptor_factory": DescriptorElementFactory.get_default_config(),
    }
開發者ID:msarahan,項目名稱:SMQTK,代碼行數:7,代碼來源:compute_many_descriptors.py


注:本文中的smqtk.representation.DescriptorElementFactory.get_default_config方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。