Ejemplo n.º 1
0
    def handleFileSelectionResponce(self, fileList, recognizer):
        """

        @param fileList:
        @return
        """

        if len(fileList) == 0:
            self.lblSelectedDir.configure(
                text="Dataset directory not yet specified")
            return
        if len(fileList) > 1:
            self.lblSelectedDir.configure(
                text="Multiple Directories selected - data is of type %s" %
                (str(recognizer)))
        else:
            self.lblSelectedDir.configure(
                text="Single Dataset Selected - data is of type %s" %
                (str(recognizer)))

        self.dataset = DatasetFactory.buildMultiset()

        with concurrent.futures.ThreadPoolExecutor() as tpe:
            dsFutures = []
            for i in fileList.keys():
                dsFutures.append(
                    tpe.submit(
                        lambda x: DatasetFactory.buildDataset(
                            fileList[x], ast.literal_eval(x), hint=recognizer),
                        i))
            for ff in dsFutures:
                self.dataset.addDataset(ff.result())

        self.plotter = Plotter.Plotter(self.dataset)
Ejemplo n.º 2
0
    def handleFileSelectionResponce(self, fileList, recognizer):
        """

        @param fileList:
        @return
        """

        if len(fileList) == 0:
            self.lblSelectedDir.configure(text="Dataset directory not yet specified")
            return
        if len(fileList) > 1:
            self.lblSelectedDir.configure(text="Multiple Directories selected - data is of type %s" % (str(recognizer)))
        else:
            self.lblSelectedDir.configure(text="Single Dataset Selected - data is of type %s" % (str(recognizer)))

        self.dataset = DatasetFactory.buildMultiset()

        with concurrent.futures.ThreadPoolExecutor() as tpe:
            dsFutures = []
            for i in fileList.keys():
                dsFutures.append(tpe.submit(lambda x: DatasetFactory.buildDataset(fileList[x],
                                                                                  ast.literal_eval(x),
                                                                                  hint=recognizer), i))
            for ff in dsFutures:
                self.dataset.addDataset(ff.result())

        self.plotter = Plotter.Plotter(self.dataset)
Ejemplo n.º 3
0
    def _setDirectory(self):
        """

        @return
        """
        selected = filedialog.askdirectory()
        self.selectedDir.configure(text=selected)
        self.dataset = DatasetFactory.buildDataset(selected + '/')
        self.plotter = Plotter.Plotter(self.dataset)
        self._plotDataset()
Ejemplo n.º 4
0
    def _setDirectory(self):
        """

        @return
        """
        selected = filedialog.askdirectory()
        self.selectedDir.configure(text=selected)
        self.dataset = DatasetFactory.buildDataset(selected + '/')
        self.plotter = Plotter.Plotter(self.dataset)
        self._plotDataset()
Ejemplo n.º 5
0
    def execute_training_and_evaluation():
        training_data_x, training_labels_y = DatasetFactory.load_training_data_and_its_labels(
        )
        evaluation_data_x, evaluation_labels_y = DatasetFactory.load_evaluation_data_and_its_labels(
        )

        network_model = ModelFactory.create_fpool3_model()

        ModelService.compile_and_fit_the_model(network_model, training_data_x,
                                               training_labels_y)
        accuracy = ModelService.evaluate_the_model(network_model,
                                                   evaluation_data_x,
                                                   evaluation_labels_y)

        file_name = ModelService.save_model_and_configuration(
            network_model, accuracy)

        print(
            'Jarvis hot word detector training has completed. File stored @ ' +
            file_name)