scripts/create_edge_impulse_dataset.py
def create_edge_impulse_dataset(excel_filepath: pathlib.Path,
                                config_filepath: pathlib.Path,
                                src_video_dir: pathlib.Path,
                                dst_root_dir: pathlib.Path) -> None:
    """
    Create image dataset for image classification in edge impulse from raw video files.
    :param excel_filepath: Path to the excel file with label information
    :param config_filepath: Path to configuration file
    :param src_video_dir: Path to the source directory containing video file
    :param dst_root_dir: Path to the destination root directory to store dataset and intermediate data
    """

    intermediate_video_dir = dst_root_dir / "inter-video"

    intermediate_video_dir.mkdir(exist_ok=True, parents=True)

    create_label_based_file_structure(excel_file_path=excel_filepath,
                                      raw_data_root_dir=src_video_dir,
                                      dst_root_dir=intermediate_video_dir)

    intermediate_frame_dir = dst_root_dir / "inter-frame"

    intermediate_frame_dir.mkdir(exist_ok=True, parents=True)

    create_frame_image_dataset(excel_filepath=excel_filepath,
                               config_filepath=config_filepath,
                               src_video_dir=intermediate_video_dir,
                               dst_frame_dir=intermediate_frame_dir)

    logging.info("Removing intermediate video data")
    shutil.rmtree(intermediate_video_dir)

    preprocess_images(config_filepath=config_filepath,
                      src_root_dir=intermediate_frame_dir,
                      dst_root_dir=intermediate_frame_dir)

    convert_file_structure_to_upload_format(src_root_dir=intermediate_frame_dir,
                                            dst_root_dir=dst_root_dir)

    logging.info("Removing intermediate frame data")
    shutil.rmtree(intermediate_frame_dir)

    Create image dataset for image classification in edge impulse from raw video files.
    :param excel_filepath: Path to the excel file with label information
    :param config_filepath: Path to configuration file
    :param src_video_dir: Path to the source directory containing video file
    :param dst_root_dir: Path to the destination root directory to store dataset and intermediate data
    
Create image dataset for image classification in edge impulse from raw video files.
Create image dataset for image classification in edge impulse from raw video files .
def create_edge_impulse_dataset(excel_filepath: pathlib.Path,
                                config_filepath: pathlib.Path,
                                src_video_dir: pathlib.Path,
                                dst_root_dir: pathlib.Path) -> None:
    intermediate_video_dir = dst_root_dir / "inter-video"
    intermediate_video_dir.mkdir(exist_ok=True, parents=True)
    create_label_based_file_structure(excel_file_path=excel_filepath,
                                      raw_data_root_dir=src_video_dir,
                                      dst_root_dir=intermediate_video_dir)
    intermediate_frame_dir = dst_root_dir / "inter-frame"
    intermediate_frame_dir.mkdir(exist_ok=True, parents=True)
    create_frame_image_dataset(excel_filepath=excel_filepath,
                               config_filepath=config_filepath,
                               src_video_dir=intermediate_video_dir,
                               dst_frame_dir=intermediate_frame_dir)
    logging.info("Removing intermediate video data")
    shutil.rmtree(intermediate_video_dir)
    preprocess_images(config_filepath=config_filepath,
                      src_root_dir=intermediate_frame_dir,
                      dst_root_dir=intermediate_frame_dir)
    convert_file_structure_to_upload_format(src_root_dir=intermediate_frame_dir,
                                            dst_root_dir=dst_root_dir)
    logging.info("Removing intermediate frame data")
    shutil.rmtree(intermediate_frame_dir)
def create_edge_impulse_dataset ( excel_filepath : pathlib . Path , config_filepath : pathlib . Path , src_video_dir : pathlib . Path , dst_root_dir : pathlib . Path ) -> None : intermediate_video_dir = dst_root_dir / "inter-video" intermediate_video_dir . mkdir ( exist_ok = True , parents = True ) create_label_based_file_structure ( excel_file_path = excel_filepath , raw_data_root_dir = src_video_dir , dst_root_dir = intermediate_video_dir ) intermediate_frame_dir = dst_root_dir / "inter-frame" intermediate_frame_dir . mkdir ( exist_ok = True , parents = True ) create_frame_image_dataset ( excel_filepath = excel_filepath , config_filepath = config_filepath , src_video_dir = intermediate_video_dir , dst_frame_dir = intermediate_frame_dir ) logging . info ( "Removing intermediate video data" ) shutil . rmtree ( intermediate_video_dir ) preprocess_images ( config_filepath = config_filepath , src_root_dir = intermediate_frame_dir , dst_root_dir = intermediate_frame_dir ) convert_file_structure_to_upload_format ( src_root_dir = intermediate_frame_dir , dst_root_dir = dst_root_dir ) logging . info ( "Removing intermediate frame data" ) shutil . rmtree ( intermediate_frame_dir )
Create image dataset for image classification in edge impulse from raw video files.
Create image dataset for image classification in edge impulse from raw video files .
"""
    Create image dataset for image classification in edge impulse from raw video files.
    :param excel_filepath: Path to the excel file with label information
    :param config_filepath: Path to configuration file
    :param src_video_dir: Path to the source directory containing video file
    :param dst_root_dir: Path to the destination root directory to store dataset and intermediate data
    """
excel_filepath
pathlib.Path
Path to the excel file with label information
Path to the excel file with label information
config_filepath
pathlib.Path
Path to configuration file
Path to configuration file
src_video_dir
pathlib.Path
Path to the source directory containing video file
Path to the source directory containing video file
dst_root_dir
pathlib.Path
Path to the destination root directory to store dataset and intermediate data
Path to the destination root directory to store dataset and intermediate data