Skip to content
Snippets Groups Projects
Select Git revision
  • d4f35e851d179be1d13542282e2e28c4409d1a32
  • master default
  • object
  • develop protected
  • private_algos
  • cuisine
  • SMOTE
  • revert-76c4cca5
  • archive protected
  • no_graphviz
  • 0.0.2
  • 0.0.1
12 results

format_dataset.py

Blame
  • PyAVA.py 1.31 KiB
    ##### IMPORTATIONS #####
    import os
    import json
    from tkinter import *
    from interface import FileExplorer, App
    from args import fetch_inputs
    
    
    ##### MAIN #####
    if __name__ == '__main__':
        # fetching inputs.
        audio_file_path, dir_explore, max_traj, new_sr, output, modify, initial_basename, parameters = fetch_inputs()
    
        if modify:
            with open(os.path.join(output, modify), "r") as f:
                coords_to_change = json.load(f)
    
            MainWindow = App(
                dir_explore, 
                max_traj, 
                new_sr, 
                output, 
                os.path.join(dir_explore, initial_basename),
                coords_to_change,
                parameters)
    
        elif len(audio_file_path)>0:
            MainWindow = App(
                dir_explore, 
                max_traj, 
                new_sr, 
                output, 
                audio_file_path,
                {},
                parameters)
        else:
            # open explorer to select first file
            groot = Tk()
            initial_file = FileExplorer(dir_explore).file
            groot.quit()
            groot.destroy()
    
            if len(initial_file) > 0:
                # launch UI
                MainWindow = App(
                    dir_explore, 
                    max_traj, 
                    new_sr, 
                    output, 
                    initial_file,
                    overwrite_parameters=parameters)