pynovisao.py 26.8 KB
Newer Older
1 2 3 4
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
"""
5 6 7 8
    This file must contain the implementation code for all actions of pynovisao.
    
    Name: pynovisao.py
    Author: Alessandro dos Santos Ferreira ( santosferreira.alessandro@gmail.com )
9 10 11
"""

from collections import OrderedDict
12
import numpy as np
13

14 15
import interface
from interface.interface import InterfaceException as IException
16

17
import segmentation
18
import extraction
19
from extraction import FeatureExtractor
20
import classification
21
from classification import Classifier
22

23 24 25
import util
from util.config import Config
from util.file_utils import File as f
26
from util.utils import TimeUtils
27 28

class Act(object):
29
    """Store all actions of Pynovisao."""
30 31

    def __init__(self, tk, args):
32 33 34 35 36 37 38 39 40
        """Constructor.

        Parameters
        ----------
        tk : Interface
            Pointer to interface that handles UI.
        args : Dictionary
            Arguments of program.
        """
41
        self.tk = tk
42 43 44
        
        self.segmenter = [segmentation._segmenter_list[segmenter].meta for segmenter in segmentation._segmenter_list
                            if segmentation._segmenter_list[segmenter].value == True ][0]()
45 46 47
        
        self.extractors = [extraction._extractor_list[extractor].meta for extractor in extraction._extractor_list
                            if extraction._extractor_list[extractor].value == True ]
48 49 50 51 52 53
        
        try:
            self.classifier = [classification._classifier_list[classifier].meta for classifier in classification._classifier_list
                                if classification._classifier_list[classifier].value == True ][0]()
        except:
            self.classifier = None
54

55 56 57
        self._image = None
        self._const_image = None
        self._image_name = None
58
                    
59 60
        self._init_dataset(args["dataset"])
        self._init_classes(args["classes"], args["colors"])
61 62
        
        self._dataset_generator = True
63 64
        self._ground_truth = False
        self._gt_segments = None
65

66
    
67
    def _init_dataset(self, directory):
68 69 70 71 72 73 74
        """Initialize the directory of image dataset.

        Parameters
        ----------
        directory : string
            Path to directory.
        """
75 76 77 78 79
        if(directory[-1] == '/'):
            directory = directory[:-1]
            
        self.dataset = directory
        f.create_dir(self.dataset)
80
    
81
    def _init_classes(self, classes = None, colors = None):
82 83 84 85 86 87 88 89 90 91
        """Initialize the classes of dataset.

        Parameters
        ----------
        classes : list of string, optional, default = None
            List of classes. If not informed, the metod set as classes all classes in dataset. 
            If there's no classes in dataset, adds two default classes.
        colors : list of string, optional, default = None
            List de colors representing the color of classe, in same order. If not informed, chooses a color at random.
        """
92 93 94 95 96 97 98 99 100 101 102 103
        self.classes = []
        
        classes = sorted(f.list_dirs(self.dataset)) if classes is None else classes.split()
        colors = [] if colors is None else colors.split()

        if(len(classes) > 0):
            for i in range(0, len(classes)):
                self.add_class(dialog = False, name=classes[i], color=colors[i] if i < len(colors) else None)
        else:
            self.add_class(dialog = False, color='Green')
            self.add_class(dialog = False, color='Yellow')
            
104
        self._current_class = 0
105
        
106

107
    def open_image(self, imagename = None):
108 109 110 111 112 113 114
        """Open a new image.

        Parameters
        ----------
        imagename : string, optional, default = None
            Filepath of image. If not informed open a dialog to choose.
        """
115 116
        
        def onclick(event):
117
            """Binds dataset generator event to click on image."""
118
            if event.xdata != None and event.ydata != None and int(event.ydata) != 0 and self._dataset_generator == True:
119 120
                x = int(event.xdata)
                y = int(event.ydata)
121 122 123 124 125 126 127
                self.tk.write_log("Coordinates: x = %d y = %d", x, y)
                
                segment, size_segment, idx_segment, run_time = self.segmenter.get_segment(x, y)
                
                if size_segment > 0:
                    self.tk.append_log("\nSegment = %d: %0.3f seconds", idx_segment, run_time)
                    
128
                    self._image, run_time = self.segmenter.paint_segment(self._image, self.classes[self._current_class]["color"].value, x, y)
129
                    self.tk.append_log("Painting segment: %0.3f seconds", run_time)
130
                    self.tk.refresh_image(self._image)
131
                    
132 133 134 135 136 137 138
                    if self._ground_truth == True:
                        self._gt_segments[idx_segment] = self.classes[self._current_class]["name"].value

                    elif self._dataset_generator == True:
                        filepath = f.save_class_image(segment, self.dataset, self.classes[self._current_class]["name"].value, self._image_name, idx_segment)
                        if filepath:
                            self.tk.append_log("\nSegment saved in %s", filepath)
139 140 141
        
        if imagename is None:
            imagename = self.tk.utils.ask_image_name()
142 143

        if imagename:
144 145
            self._image = f.open_image(imagename)
            self._image_name = f.get_filename(imagename)
146

147 148 149
            self.tk.write_log("Opening %s...", self._image_name)
            self.tk.add_image(self._image, self._image_name, onclick)
            self._const_image = self._image
150
            
151
            self.segmenter.reset()
152
            self._gt_segments = None
153

154 155
        
    def restore_image(self):
156 157
        """Refresh the image and clean the segmentation.
        """
158 159 160 161
        if self._const_image is not None:
            self.tk.write_log("Restoring image...")
            self.tk.refresh_image(self._const_image)
            
162
            self.segmenter.reset()
163
            self._gt_segments = None
164 165
        
    def close_image(self):
166
        """Close the image.
167
        
168 169 170 171 172
        Raises
        ------
        IException 'Image not found'
            If there's no image opened.
        """
173
        if self._const_image is None:
174 175 176 177
            raise IException("Image not found")
        
        if self.tk.close_image():
            self.tk.write_log("Closing image...")
178
            self._const_image = None
179
            self._image = None
180 181

    def add_class(self, dialog = True, name = None, color = None):
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
        """Add a new class.

        Parameters
        ----------
        dialog : boolean, optional, default = True
            If true open a config dialog to add the class.
        name : string, optional, default = None
            Name of class. If not informed set the name 'Class_nn' to class.
        color : string, optional, default = None
            Name of color in X11Color format, representing the class. It will used to paint the segments of class.
            If not informed choose a color at random.
            
        Raises
        ------
        IException 'You have reached the limite of %d classes'
            If you already have created self.tk.MAX_CLASSES classes.
        """
199 200 201
        n_classes = len(self.classes)
        if n_classes >= self.tk.MAX_CLASSES:
            raise IException("You have reached the limite of %d classes" % self.tk.MAX_CLASSES)
202
                
203
        def edit_class(index):
204
            """Calls method that edit the class."""
205
            self.edit_class(index)
206 207
            
        def update_current_class(index):
208
            """Calls method that update the class."""
209
            self.update_current_class(index)
210 211
        
        def process_config():
212
            """Add the class and refresh the panel of classes."""
213
            new_class = self.tk.get_config_and_destroy()
214
            new_class["name"].value = '_'.join(new_class["name"].value.split())
215 216 217

            self.classes.append( new_class )
            self.tk.write_log("New class: %s", new_class["name"].value)
218
            self.tk.refresh_panel_classes(self.classes, self._current_class)
219
            
220 221
        if name is None:
            name = "Class_%02d" % (n_classes+1)
222
        if color is None:
223
            color = util.X11Colors.random_color()
224 225
            
        class_config = OrderedDict()
226
        class_config["name"] = Config(label="Name", value=name, c_type=str)
227
        class_config["color"] = Config(label="Color (X11 Colors)", value=color, c_type='color')
228 229
        class_config["callback"] = Config(label=None, value=update_current_class, c_type=None, hidden=True)
        class_config["callback_color"] = Config(label=None, value=edit_class, c_type=None, hidden=True)
230 231 232 233 234 235 236
        class_config["args"] = Config(label=None, value=n_classes, c_type=int, hidden=True)
        
        if dialog == False:
            self.classes.append( class_config )
            return 

        title = "Add a new classe"
237 238 239
        self.tk.dialogue_config(title, class_config, process_config)        
      

240
    def edit_class(self, index):
241 242 243 244 245 246 247
        """Edit a class.

        Parameters
        ----------
        index : integer.
            Index of class in list self.classes.
        """
248
        def process_update(index):
249
            """Update the class."""
250
            updated_class = self.tk.get_config_and_destroy()
251
            updated_class["name"].value = '_'.join(updated_class["name"].value.split())
252 253 254
            
            self.classes[index] = updated_class
            self.tk.write_log("Class updated: %s", updated_class["name"].value)
255
            self.tk.refresh_panel_classes(self.classes, self._current_class)
256 257 258 259 260 261
        
        current_config = self.classes[index]
            
        title = "Edit class %s" % current_config["name"].value
        self.tk.dialogue_config(title, current_config, lambda *_ : process_update(index))
            
262
    def update_current_class(self, index):
263 264
        """Update the current class.
        """
265
        self._current_class = index
266 267
        
    def get_class_by_name(self, name):
268 269 270 271
        """Return the index for class.
        
        Parameters
        ----------
272
        name : string
273 274 275 276
            Name of class.
            
        Returns
        -------
277
        index : integer
278 279 280 281 282 283 284
            Index of class in list self.classes.

        Raises
        ------
        Exception 'Class not found'
            If name not found in self.classes.
        """
285 286 287 288 289 290
        name = name.strip()
        
        for cl in self.classes:
            if cl["name"].value == name:
                return cl
        raise Exception("Class not found")
291

292
        
293
    def set_dataset_path(self):
294 295
        """Open a dialog to choose the path to directory of image dataset.
        """
296 297
        directory = self.tk.utils.ask_directory(default_dir = self.dataset)
        if directory:
298
            self._init_dataset(directory)
299 300
            self.tk.write_log("Image dataset defined: %s", self.dataset)
            
301
            self._init_classes()
302
            self.tk.refresh_panel_classes(self.classes)
303
            
304 305
            if self.classifier: self.classifier.reset()
            
306
    def toggle_dataset_generator(self):
307 308
        """Enable/disable the dataset generator on click in image.
        """
309
        self._dataset_generator = not self._dataset_generator
310

311 312
            
    def select_segmenter(self):
313 314
        """Open a dialog to choose the segmenter.
        """
315 316
        title = "Choosing a segmenter"
        self.tk.write_log(title)
317

318
        current_config = segmentation.get_segmenter_config()
319
        
320
        def process_config():
321
            """Update the current segmenter."""
322
            new_config = self.tk.get_config_and_destroy()
323

324 325 326
            self.segmenter = [new_config[segmenter].meta for segmenter in new_config
                                if new_config[segmenter].value == True ][0]()

327
            self.tk.append_log("\nSegmenter: %s\n%s", str(self.segmenter.get_name()), str(self.segmenter.get_summary_config()))
328 329 330 331 332
            segmentation.set_segmenter_config(new_config)

        self.tk.dialogue_choose_one(title, current_config, process_config)

    def config_segmenter(self):
333 334
        """Open a dialog to configure the current segmenter.
        """
335 336 337 338 339 340
        title = "Configuring %s" % self.segmenter.get_name()
        self.tk.write_log(title)

        current_config = self.segmenter.get_config()
        
        def process_config():
341
            """Update the configs of current segmenter."""
342 343 344
            new_config = self.tk.get_config_and_destroy()

            self.segmenter.set_config(new_config)
345
            self.tk.append_log("\nConfig updated:\n%s", str(self.segmenter.get_summary_config()))
346
            self.segmenter.reset()
347 348

        self.tk.dialogue_config(title, current_config, process_config)
349 350
        
    def run_segmenter(self):
351
        """Do the segmentation of image, using the current segmenter.
352
        
353 354 355 356 357
        Raises
        ------
        IException 'Image not found'
            If there's no image opened.
        """
358 359 360
        if self._const_image is None:
            raise IException("Image not found")
        
361
        self.tk.write_log("Running %s...", self.segmenter.get_name())
362 363 364 365 366

        self.tk.append_log("\nConfig: %s", str(self.segmenter.get_summary_config()))
        self._image, run_time = self.segmenter.run(self._const_image)
        self.tk.append_log("Time elapsed: %0.3f seconds", run_time)
        
367 368
        self._gt_segments = [None]*(max(self.segmenter.get_list_segments())+1)
        
369
        self.tk.refresh_image(self._image)
370 371


372
    def select_extractors(self):
373
        """Open a dialog to select the collection of extractors.
374
        
375 376 377 378 379
        Raises
        ------
        IException 'Please select at least one extractor'
            If no extractor was selected.
        """
380 381 382 383 384 385
        title = "Selecting extractors"
        self.tk.write_log(title)

        current_config = extraction.get_extractor_config()
        
        def process_config():
386
            """Update the collection of extractors."""
387 388 389 390
            new_config = self.tk.get_config_and_destroy()

            self.extractors = [new_config[extractor].meta for extractor in new_config
                                if new_config[extractor].value == True ]
391 392 393
                                
            if len(self.extractors) == 0:
                raise IException("Please select at least one extractor")
394 395 396 397 398 399 400

            self.tk.append_log("\nConfig updated:\n%s", 
                                '\n'.join(["%s: %s" % (new_config[extractor].label, "on" if new_config[extractor].value==True else "off")
                                            for extractor in new_config]))
            extraction.set_extractor_config(new_config)

        self.tk.dialogue_select(title, current_config, process_config)
401 402
        
    def run_extractors(self):
403 404
        """Perform a feature extraction on all images of dataset, using the current collection of extractors.
        """
405
        self.tk.write_log("Running extractors on all images in %s", self.dataset)
406

407 408 409
        fextractor = FeatureExtractor(self.extractors)
        self.tk.append_log("%s", '\n'.join([extraction._extractor_list[extractor].label for extractor in extraction._extractor_list
                                                if extraction._extractor_list[extractor].value == True ]))
410
        
411
        output_file, run_time = fextractor.extract_all(self.dataset, "training")
412 413
        self.tk.append_log("\nOutput file saved in %s", output_file)
        self.tk.append_log("Time elapsed: %0.3f seconds", run_time)
414 415
        
        if self.classifier: self.classifier.reset()
416

417 418
        
    def select_classifier(self):
419 420 421 422 423 424 425
        """Open a dialog to select the classifier.
        
        Raises
        ------
        IException 'You must install python-weka-wrapper'
            The user must install the required dependencies to classifiers.
        """
426 427 428 429 430 431 432 433 434
        if self.classifier is None:
            raise IException("You must install python-weka-wrapper")
        
        title = "Choosing a classifier"
        self.tk.write_log(title)

        current_config = classification.get_classifier_config()
        
        def process_config():
435
            """Update the current classifier."""
436 437 438 439 440 441 442 443 444 445 446
            new_config = self.tk.get_config_and_destroy()

            self.classifier = [new_config[classifier].meta for classifier in new_config
                                if new_config[classifier].value == True ][0]()

            self.tk.append_log("\nClassifier: %s\n%s", str(self.classifier.get_name()), str(self.classifier.get_summary_config()))
            classification.set_classifier_config(new_config)

        self.tk.dialogue_choose_one(title, current_config, process_config)
        
    def configure_classifier(self):
447 448 449 450 451 452 453
        """Set the configuration of current classifier.
        
        Raises
        ------
        IException 'You must install python-weka-wrapper'
            The user must install the required dependencies to classifiers.
        """
454 455 456 457 458 459 460 461 462 463 464 465 466
        if self.classifier is None:
            raise IException("You must install python-weka-wrapper")
        
        title = "Configuring %s" % self.classifier.get_name()
        self.tk.write_log(title)

        current_config = self.classifier.get_config()
        
        def process_config():
            new_config = self.tk.get_config_and_destroy()

            self.classifier.set_config(new_config)
            self.tk.append_log("\nConfig updated:\n%s", str(self.classifier.get_summary_config()))
467 468
            
            if self.classifier: self.classifier.reset()
469 470 471 472 473

        self.tk.dialogue_config(title, current_config, process_config)
    
    
    def run_classifier(self):
474 475 476 477 478 479 480 481 482 483
        """Run the classifier on the current image.
        As result, paint the image with color corresponding to predicted class of all segment.
        
        Raises
        ------
        IException 'You must install python-weka-wrapper'
            The user must install the required dependencies to classifiers.
        IException 'Image not found'
            If there's no image opened.
        """
484 485 486 487 488 489 490 491 492 493 494
        if self.classifier is None:
            raise IException("You must install python-weka-wrapper")
        
        if self._const_image is None:
            raise IException("Image not found")
        
        self.tk.write_log("Running %s...", self.classifier.get_name())
        self.tk.append_log("\n%s", str(self.classifier.get_summary_config()))
        
        start_time = TimeUtils.get_time()

495
        # Perform a segmentation, if needed.
496 497 498 499 500 501 502
        list_segments = self.segmenter.get_list_segments()
        if len(list_segments) == 0:
            self.tk.append_log("Running %s... (%0.3f seconds)", self.segmenter.get_name(), (TimeUtils.get_time() - start_time))
            
            self._image, _ = self.segmenter.run(self._const_image)
            self.tk.refresh_image(self._image)        
            list_segments = self.segmenter.get_list_segments()
503
            self._gt_segments = [None]*(max(list_segments)+1)
504
        
505
        # Train the classifier ( this program does not perform the training of ConvNets ).
506
        if self.classifier.must_train():
507
            self.tk.append_log("Creating training data... (%0.3f seconds)", (TimeUtils.get_time() - start_time))
508 509
            
            fextractor = FeatureExtractor(self.extractors)
510
            output_file, run_time = fextractor.extract_all(self.dataset, "training", overwrite = False)
511 512 513
        
            self.tk.append_log("Training classifier... (%0.3f seconds)", (TimeUtils.get_time() - start_time))
            
514
            self.classifier.train(self.dataset, "training")
515 516 517
        
        self._image = self._const_image

518
        
519
        #  New and optimized classification
520 521
        tmp = ".tmp"
        f.remove_dir(f.make_path(self.dataset, tmp))
522

523 524 525 526 527
        self.tk.append_log("Generating test images... (%0.3f seconds)", (TimeUtils.get_time() - start_time))
        
        len_segments = {}
        for idx_segment in list_segments:
            segment, size_segment, idx_segment = self.segmenter.get_segment(self, idx_segment=idx_segment)[:-1]
528
            
529 530
            filepath = f.save_class_image(segment, self.dataset, tmp, self._image_name, idx_segment)
            len_segments[idx_segment] = size_segment
531
            
532
        # Perform the feature extraction of all segments in image ( not applied to ConvNets ).
533 534
        if self.classifier.must_train():
            self.tk.append_log("Running extractors on test images... (%0.3f seconds)", (TimeUtils.get_time() - start_time))
535
            
536 537 538
            output_file, _ = fextractor.extract_all(self.dataset, "test", dirs=[tmp])
                
        self.tk.append_log("Running classifier on test data... (%0.3f seconds)", (TimeUtils.get_time() - start_time))
539 540

        # Get the label corresponding to predict class for each segment of image.
541
        labels = self.classifier.classify(self.dataset, test_dir=tmp, test_data="test.arff")
542 543 544 545
        f.remove_dir(f.make_path(self.dataset, tmp))
        
        self.tk.append_log("Painting segments... (%0.3f seconds)", (TimeUtils.get_time() - start_time))
        
546 547 548
        # If ground truth mode, show alternative results
        if self._ground_truth == True:
            return self._show_ground_truth(list_segments, len_segments, labels, start_time)
549

550
        # Create a popup with results of classification.
551 552 553 554 555
        popup_info = "%s\n" % str(self.classifier.get_summary_config())
        
        len_total = sum([len_segments[idx] for idx in len_segments])
        popup_info += "%-16s%-16s%0.2f%%\n" % ("Total", str(len_total), (len_total*100.0)/len_total)
        
556
        # Paint the image.
557 558 559 560 561 562 563 564 565 566 567 568
        for cl in self.classes:
            idx_segment = [ list_segments[idx] for idx in range(0, len(labels)) if cl["name"].value == labels[idx]]
            if len(idx_segment) > 0:
                self._image, _ = self.segmenter.paint_segment(self._image, cl["color"].value, idx_segment=idx_segment, border=False)
              
            len_classes = sum([len_segments[idx] for idx in idx_segment])
            popup_info += "%-16s%-16s%0.2f%%\n" % (cl["name"].value, str(len_classes), (len_classes*100.0)/len_total)

        self.tk.refresh_image(self._image)
        self.tk.popup(popup_info)

        
569 570 571 572
        end_time = TimeUtils.get_time()
            
        self.tk.append_log("\nClassification finished")
        self.tk.append_log("Time elapsed: %0.3f seconds", (end_time - start_time))
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614
        
    
    def _show_ground_truth(self, list_segments, len_segments, labels, start_time):
        """Paint only wrong classified segments and show ground truth confusion matrix.
        
        Parameters
        ----------
        list_segments : list of integer
            List of index segments.
        len_segments : list of integer
            List of segments sizes.
        labels : list of string
            List of predicted class name for each segment.
        start_time : floating point
            Start time of classification.
        """
        classes = list(set(labels))
        classes.sort()
        
        n_segments = len(labels)
        spx_matrix = np.zeros((len(classes), len(classes)), np.int) 
        px_matrix = np.zeros((len(classes), len(classes)), np.int) 

        # Create the confusion matrix and paint wrong classified segments individually.
        for idx_segment in list_segments:
            if self._gt_segments[idx_segment] is not None:
                gt_class = classes.index(self._gt_segments[idx_segment])
                predicted_class = classes.index(labels[idx_segment])
                
                spx_matrix[ gt_class ][ predicted_class ] += 1
                px_matrix[ gt_class ][ predicted_class ] += len_segments[idx_segment]
        
                if gt_class != predicted_class:
                    self._image, _ = self.segmenter.paint_segment(self._image, self.get_class_by_name(labels[idx_segment])["color"].value, idx_segment=[idx_segment], border=False)
        
        # Create a popup with results of classification.
        popup_info = "%s\n" % str(self.classifier.get_summary_config())
        popup_info += Classifier.confusion_matrix(classes, spx_matrix, "Superpixels")
        popup_info += Classifier.confusion_matrix(classes, px_matrix, "PixelSum")
        
        self.tk.refresh_image(self._image)
        self.tk.popup(popup_info)
615

616 617 618 619 620
        end_time = TimeUtils.get_time()
            
        self.tk.append_log("\nClassification finished")
        self.tk.append_log("Time elapsed: %0.3f seconds", (end_time - start_time))
        
621

622 623 624 625 626
    def toggle_ground_truth(self):
        """Enable/disable ground truth mode.
        """
        self._ground_truth = not self._ground_truth
        
627
    def cross_validation(self):
628 629 630 631 632 633 634
        """Run a cross validation on all generated segments in image dataset.
        
        Raises
        ------
        IException 'You must install python-weka-wrapper'
            The user must install the required dependencies to classifiers.
        """
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650
        if self.classifier is None:
            raise IException("You must install python-weka-wrapper")
        
        if self.classifier.must_train():
            self.tk.write_log("Creating training data...")
            
            fextractor = FeatureExtractor(self.extractors)
            output_file, run_time = fextractor.extract_all(self.dataset, "training", overwrite = False)
            self.classifier.train(self.dataset, "training")
        
        self.tk.write_log("Running Cross Validation on %s...", self.classifier.get_name())
        self.tk.append_log("\n%s", str(self.classifier.get_summary_config()))
        
        popup_info = self.classifier.cross_validate()
        self.tk.append_log("Cross Validation finished")
        self.tk.popup(popup_info)
651 652
        
    def experimenter_all(self):
653 654 655 656 657 658 659
        """Perform a test in all availabel classifiers e show the results.
        
        Raises
        ------
        IException 'You must install python-weka-wrapper'
            The user must install the required dependencies to classifiers.
        """
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
        if self.classifier is None:
            raise IException("You must install python-weka-wrapper")
        
        if self.tk.ask_ok_cancel("Experimenter All", "This may take several minutes to complete. Are you sure?"):
            if self.classifier.must_train():
                self.tk.write_log("Creating training data...")
                
                fextractor = FeatureExtractor(self.extractors)
                output_file, run_time = fextractor.extract_all(self.dataset, "training", overwrite = False)
                self.classifier.train(self.dataset, "training")
                
            self.tk.write_log("Running Experimenter All on %s...", self.classifier.get_name())
            
            popup_info = self.classifier.experimenter()
            self.tk.append_log("\nExperimenter All finished")
            self.tk.popup(popup_info)
676 677


678 679 680 681
    def about(self):
        self.tk.show_info("Pynovisao\n\nVersion 1.0.0\n\nAuthors:\nAlessandro Ferreira\nHemerson Pistori")
        
            
682
    def func_not_available(self):
683
        """Use this method to bind menu options not available."""
684
        self.tk.write_log("This functionality is not available right now.")
685