from utils import *


if __name__ == '__main__':  
    
    start_time = datetime.datetime.now()
    # # Get Json File With All Frame & Save XML File
    # combine_json_files(
    #     "demo/2023_02_02_15_55_38",
    #     total_frames=359, 
    #     interval=5, 
    #     save_xml=True
    # )
    # # Get Statistics Json File With All Frame & Save XML File
    # get_statistics(
    #     "demo_2023_02_02_15_55_38.json", 
    #     save_xml=True
    # )
    # # Get Json File With All Frame & Save XML File 
    # combine_json_files(
    #     "demo01/2023_02_03_10_35_39",
    #     total_frames=359, 
    #     interval=5, 
    #     save_xml=True
    # )
    # Get Statistics Json File With All Frame & Save XML File
    # get_statistics(
    #     "/var/www/html/BCA/src/V2/video_comp_2023_02_04_13_59_34.json", 
    #     save_xml=True
    # )
    # get_outputs(
    #     # json_path="/var/www/html/BCA/src/V2/demo01_2023_02_03_10_35_39.json",
    #     # file_path="/var/www/html/BCA/src/images/demo01.png" 
    #     # file_path="/var/www/html/BCA/src/demo.mp4",
    #     # json_path="/var/www/html/BCA/src/V2/demo_2023_02_02_15_55_38.json"
    # )


    # json_to_csv(
    #     "/var/www/html/BCA/src/V2/video_comp_2023_02_04_14_31_17.json", 
    # )
    get_outputs(
        file_path="/var/www/html/BCA/src/Info_Soir_Dimanche_07_Mai_2023.mp4",
        json_path="/var/www/html/BCA/src/V2/Info_Soir_Dimanche_07_Mai_2023_2023_05_08_19_46_02.json"
    )    
    get_statistics(
        "/var/www/html/BCA/src/V2/Info_Soir_Dimanche_07_Mai_2023_2023_05_08_19_46_02.json", 
        save_xml=True
    )
    json_to_csv(
        "/var/www/html/BCA/src/V2/Info_Soir_Dimanche_07_Mai_2023_2023_05_08_19_46_02.json", 
    )
    end_time = datetime.datetime.now()
    print(f'{(end_time - start_time).total_seconds()} seconds')