Пример #1
0
 def OnLoadClassifier(self, event=None):
     from PYME.Analysis import svmSegment
     filename = wx.FileSelector("Load Classifier:",
                                wildcard="*.pkl",
                                flags=wx.FD_OPEN)
     if not filename == '':
         self.cf = svmSegment.svmClassifier(filename=filename)
Пример #2
0
 def _loadClassifier(self):
     from PYME.Analysis import svmSegment
     if not (('_cf' in dir(self)) and
             (self._classifier == self.classifier)):
         self._classifier = self.classifier
         with unifiedIO.local_or_temp_filename(self.classifier) as fn:
             self._cf = svmSegment.svmClassifier(filename=fn)
Пример #3
0
    def OnSVMTrain(self, event):
        from PYME.Analysis import svmSegment

        #from PYME.IO.image import ImageStack
        #from PYME.DSView import ViewIm3D

        if not 'cf' in dir(self):
            self.cf = svmSegment.svmClassifier()

        self.cf.train(self.image.data[:, :, self.do.zp, 0].squeeze(),
                      self.image.labels[:, :, self.do.zp])
        self.OnSVMSegment(None)
Пример #4
0
    def train_svm(self, event=None):
        from PYME.Analysis import svmSegment

        #from PYME.IO.image import ImageStack
        #from PYME.DSView import ViewIm3D

        if not 'cf' in dir(self):
            self.cf = svmSegment.svmClassifier()

        self.cf.train(self.dsviewer.image.data[:, :, self.do.zp, 0].squeeze(),
                      self.rasterize(self.do.zp))

        self.svm_segment()
Пример #5
0
    def train_naive_bayes(self, event=None):
        from PYME.Analysis import svmSegment
        from sklearn.naive_bayes import GaussianNB

        #from PYME.IO.image import ImageStack
        #from PYME.DSView import ViewIm3D

        clf = GaussianNB()

        #if not 'cf' in dir(self):
        #if not 'cf' in dir(self):
        self.cf = svmSegment.svmClassifier(clf=clf)

        self.cf.train(self.dsviewer.image.data[:, :, self.do.zp, 0].squeeze(),
                      self.rasterize(self.do.zp))

        self.svm_segment()
 def _loadClassifier(self):
     from PYME.Analysis import svmSegment
     if not '_cf' in dir(self):
         self._cf = svmSegment.svmClassifier(filename=self.classifier)