diff --git a/lecture2notes/end_to_end/frames_extractor.py b/lecture2notes/end_to_end/frames_extractor.py index 58d6809..9a88099 100644 --- a/lecture2notes/end_to_end/frames_extractor.py +++ b/lecture2notes/end_to_end/frames_extractor.py @@ -34,6 +34,18 @@ def extract_frames(input_video_path, quality, output_path, extract_every_x_secon logger.debug("Running command: " + command) os.system(command) + + for filename in os.listdir(output_path): + if filename.endswith(".jpg"): + new_number = int(filename.split("_")[1].split(".")[0]) * int( + extract_every_x_seconds + ) + new_filename = "img_" + str(new_number).zfill(5) + ".jpg" + os.rename( + os.path.join(output_path, filename), + os.path.join(output_path, new_filename), + ) + logger.info( "Frame extraction successful. Returning output_path=" + str(output_path) ) diff --git a/lecture2notes/end_to_end/summarization_approaches.py b/lecture2notes/end_to_end/summarization_approaches.py index 00aeabd..eaa2506 100644 --- a/lecture2notes/end_to_end/summarization_approaches.py +++ b/lecture2notes/end_to_end/summarization_approaches.py @@ -1044,7 +1044,7 @@ def structured_joined_sum( final_dict[title] = {"transcript": coresponding_transcript_text.strip()} final_dict[title]["slide_content"] = all_slide_content - final_dict[title]["frame_number"] = slide["frame_number"] + final_dict[title]["frame_number"] = slide["frame_number"] * frame_every_x if "figure_paths" in slide.keys(): final_dict[title]["figure_paths"] = slide["figure_paths"]