def __init__(self, operator, projectFileGroupName):
        self.VERSION = 1
        self._serialClassifierSlot = SerialClassifierSlot(
            operator.Classifier,
            operator.classifier_cache,
            name="ClassifierForests")
        slots = [
            SerialListSlot(operator.LabelNames),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialPickleableSlot(operator.Bookmarks, self.VERSION),
            BackwardsCompatibleLabelSerialBlockSlot(
                operator.LabelImages,
                operator.LabelInputs,
                operator.NonzeroLabelBlocks,
                name="LabelSets",
                subname="labels{:03d}",
                selfdepends=False,
                shrink_to_bb=True,
            ),
            SerialClassifierFactorySlot(operator.ClassifierFactory),
            self._serialClassifierSlot,
        ]

        super(PixelClassificationSerializer,
              self).__init__(projectFileGroupName, slots, operator)
Beispiel #2
0
 def __init__(self, operator, projectFileGroupName):
     slots = [
         SerialDictSlot(operator.FeatureNames),
         SerialEdgeLabelsDictSlot(operator.EdgeLabelsDict),
         SerialRagSlot(operator.Rag, operator.opRagCache,
                       operator.Superpixels),
         SerialCachedDataFrameSlot(operator.opEdgeFeaturesCache.Output,
                                   operator.opEdgeFeaturesCache,
                                   name="EdgeFeatures"),
         SerialClassifierSlot(operator.opClassifierCache.Output,
                              operator.opClassifierCache)
     ]
     super(EdgeTrainingSerializer, self).__init__(projectFileGroupName,
                                                  slots=slots)
Beispiel #3
0
    def __init__(self, operator, projectFileGroupName):
        self._serialClassifierSlot =  SerialClassifierSlot(operator.Classifier,
                                                           operator.classifier_cache,
                                                           name="ClassifierForests")
        slots = [SerialListSlot(operator.LabelNames,
                                transform=str),
                 SerialListSlot(operator.LabelColors, transform=lambda x: tuple(x.flat)),
                 SerialListSlot(operator.PmapColors, transform=lambda x: tuple(x.flat)),
                 SerialBlockSlot(operator.LabelImages,
                                 operator.LabelInputs,
                                 operator.NonzeroLabelBlocks,
                                 name='LabelSets',
                                 subname='labels{:03d}',
                                 selfdepends=False,
                                 shrink_to_bb=True),
                 SerialClassifierFactorySlot(operator.ClassifierFactory),
                 self._serialClassifierSlot ]

        super(PixelClassificationSerializer, self).__init__(projectFileGroupName, slots, operator)
Beispiel #4
0
    def __init__(self, operator, projectFileGroupName):
        self.VERSION = 1  # Make sure to bump the version in case you make any changes in the serialization
        self._serialClassifierSlot = SerialClassifierSlot(
            operator.Classifier,
            operator.classifier_cache,
            name="ClassifierForests")
        slots = [
            SerialListSlot(operator.LabelNames),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialPickleableSlot(operator.Bookmarks, self.VERSION),
            SerialBlockSlot(
                operator.LabelImages,
                operator.LabelInputs,
                operator.NonzeroLabelBlocks,
                name="LabelSets",
                subname="labels{:03d}",
                selfdepends=False,
                shrink_to_bb=True,
            ),
            SerialClassifierFactorySlot(operator.ClassifierFactory),
            self._serialClassifierSlot,
            SerialBlockSlot(
                operator.opSupervoxelFeaturesAndLabels.SupervoxelFeatures,
                operator.opSupervoxelFeaturesAndLabels.
                CacheSupervoxelFeaturesInput,
                operator.opSupervoxelFeaturesAndLabels.
                SupervoxelFeaturesCleanBlocks,
            ),
            SerialBlockSlot(
                operator.opSupervoxelFeaturesAndLabels.SupervoxelLabels,
                operator.opSupervoxelFeaturesAndLabels.
                CacheSupervoxelLabelsInput,
                operator.opSupervoxelFeaturesAndLabels.
                SupervoxelLabelsCleanBlocks,
            ),
        ]

        super(VoxelSegmentationSerializer,
              self).__init__(projectFileGroupName, slots, operator)
    def __init__(self, topGroupName, operator):
        serialSlots = [
            SerialDictSlot(operator.SelectedFeatures, transform=str),
            SerialListSlot(operator.LabelNames,
                           transform=str),
            SerialListSlot(operator.LabelColors, transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors, transform=lambda x: tuple(x.flat)),
            SerialDictSlot(operator.LabelInputs, transform=int),
            SerialClassifierSlot(operator.Classifier,
                                 operator.classifier_cache,
                                 name="ClassifierForests",
                                 subname="Forest{:04d}"),
            SerialDictSlot(operator.CachedProbabilities,
                           operator.InputProbabilities,
                           transform=int),
        ]

        super(ObjectClassificationSerializer, self ).__init__(topGroupName,
                                                              slots=serialSlots,
                                                              operator=operator)
Beispiel #6
0
    def __init__(self, topGroupName, operator):
        serialSlots = [
            SerialDictSlot(operator.SelectedFeatures, transform=str),
            SerialListSlot(operator.LabelNames, transform=str),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialDictSlot(operator.LabelInputs, transform=int),
            SerialClassifierSlot(operator.Classifier,
                                 operator.classifier_cache,
                                 name="ClassifierForests"),
            SerialDictSlot(operator.CachedProbabilities,
                           operator.InputProbabilities,
                           transform=int),
            #SerialDictSlotWithoutDeserialization(operator.Probabilities, operator, transform=str)
            SerialPickledValueSlot(operator.ExportSettings)
        ]

        super(ObjectClassificationSerializer, self).__init__(topGroupName,
                                                             slots=serialSlots,
                                                             operator=operator)
    def __init__(self, topGroupName, operator):
        self.VERSION = 1  # Make sure to bump the version in case you make any changes in the serialization
        serialSlots = [
            SerialDictSlot(operator.SelectedFeatures),
            SerialListSlot(operator.LabelNames),
            SerialListSlot(operator.LabelColors,
                           transform=lambda x: tuple(x.flat)),
            SerialListSlot(operator.PmapColors,
                           transform=lambda x: tuple(x.flat)),
            SerialDictSlot(operator.LabelInputs, transform=int),
            SerialClassifierSlot(operator.Classifier,
                                 operator.classifier_cache,
                                 name="ClassifierForests"),
            SerialDictSlot(operator.CachedProbabilities,
                           operator.InputProbabilities,
                           transform=int),
            SerialSlot(operator.MaxNumObj),
            SerialPickleableSlot(operator.ExportSettings, self.VERSION, None)
        ]

        super(ObjectClassificationSerializer, self).__init__(topGroupName,
                                                             slots=serialSlots,
                                                             operator=operator)