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
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] = make_default_config( DescriptorGenerator.get_impls() ) # Descriptor factory for new content descriptors c[cls.CONFIG_DESCRIPTOR_FACTORY] = \ DescriptorElementFactory.get_default_config() # Optional Descriptor set for "included" descriptors referenceable by # UID. c[cls.CONFIG_DESCRIPTOR_SET] = make_default_config( DescriptorSet.get_impls() ) # from-IQR-state *supervised* classifier configuration c[cls.CONFIG_IQR_CLASSIFIER] = make_default_config( SupervisedClassifier.get_impls() ) c[cls.CONFIG_IMMUTABLE_LABELS] = [] return c
def test_get_default_config(self): # Returns a non-empty dictionary with just the example key. Contains # a sub-dictionary that would container the implementation # specifications. c = ClassifierCollection.get_default_config() # Should just contain the default example self.assertEqual(len(c), 1) self.assertIn('__example_label__', c.keys()) # Should be a plugin config after this. self.assertIn('type', c['__example_label__'])