This module contains all the necessary functions for loading and preprocessing videos into a standard format to be used in the rest of the pipeline.

get_rand_imgs[source]

get_rand_imgs(vid_path, max_msecs, n=10)

vid_from_frames[source]

vid_from_frames(frames, output=None, fr=30)

Generate video from list of frame paths.

test_path = Path("<path>")
vid_from_frames(test_path, Path('.'))

class Video[source]

Video(vid_path, fr=None, overwrite=False)

vid_path = Path("<path>"); vid_path
vid = Video(vid_path)

View a single frame of a video

vid.show_frame(80)

Get the number of frames in a video

len(vid)

class VideoDataset[source]

VideoDataset(videos)

vid_ds = VideoDataset.from_path(vid_path).label_from_paths()

Get all apps contained in the dataset

vid_ds.get_labels()

Access all videos that belong to a particular bug

vid_ds['app']['bug']

get_rico_imgs[source]

get_rico_imgs(path, n=None)

read_video_data[source]

read_video_data(file_path)

get_non_duplicate_corpus[source]

get_non_duplicate_corpus(bugs, bug_idx, app_bugs, br_idx, bugs_to_exclude=[])

generate_setting2[source]

generate_setting2(data, out_path)

path = Path('/tf/data/')
csv_file_path = path/'artifacts/user_assignment.csv'
video_data = read_video_data(csv_file_path)
generate_setting2(video_data, path/'outputs/evaluation_settings')

get_all_texts[source]

get_all_texts(vid_path, out_path, fps)

path = Path('/tf/data/')
vid_path = path/'artifacts/videos'
out_path = path/'artifacts/extracted_text'
get_all_texts(vid_path, out_path, 1)
from nbdev.export import notebook2script
notebook2script()