本文整理匯總了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
示例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
示例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())
}
示例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()),
}
示例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')
示例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 = {}
示例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
示例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(),
}