added logging for slide detection and sorting for clarity
Browse files- detector.py +3 -0
- file_processor.py +2 -0
detector.py
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
|
3 |
import argparse
|
4 |
import cProfile
|
|
|
5 |
import pstats
|
6 |
|
7 |
import cv2
|
@@ -62,6 +63,8 @@ class Detector(Analyzer):
|
|
62 |
with tqdm(total=self.sequence.len, desc='Detecting Slides: ') as pbar:
|
63 |
for i, frame in self.check_transition():
|
64 |
if frame is not None:
|
|
|
|
|
65 |
frames.append(Slide(name_getter.next_name([i]), frame))
|
66 |
pbar.update(1)
|
67 |
|
|
|
2 |
|
3 |
import argparse
|
4 |
import cProfile
|
5 |
+
import logging
|
6 |
import pstats
|
7 |
|
8 |
import cv2
|
|
|
63 |
with tqdm(total=self.sequence.len, desc='Detecting Slides: ') as pbar:
|
64 |
for i, frame in self.check_transition():
|
65 |
if frame is not None:
|
66 |
+
if i % 10 == 0:
|
67 |
+
logging.info(f"{i} Slides detected")
|
68 |
frames.append(Slide(name_getter.next_name([i]), frame))
|
69 |
pbar.update(1)
|
70 |
|
file_processor.py
CHANGED
@@ -13,9 +13,11 @@ def process_video(link):
|
|
13 |
temp_video_file_path, audio_path = download_mp4_and_extract_audio(link)
|
14 |
|
15 |
detector = Detector(temp_video_file_path)
|
|
|
16 |
detected_slides = detector.detect_slides()
|
17 |
|
18 |
sorter = SlideSorter(sources.ListSource(detected_slides))
|
|
|
19 |
sorted_slides = sorter.sort()
|
20 |
|
21 |
os.remove(temp_video_file_path)
|
|
|
13 |
temp_video_file_path, audio_path = download_mp4_and_extract_audio(link)
|
14 |
|
15 |
detector = Detector(temp_video_file_path)
|
16 |
+
logging.info("Detecting Slides...")
|
17 |
detected_slides = detector.detect_slides()
|
18 |
|
19 |
sorter = SlideSorter(sources.ListSource(detected_slides))
|
20 |
+
logging.info("Sorting Slides...")
|
21 |
sorted_slides = sorter.sort()
|
22 |
|
23 |
os.remove(temp_video_file_path)
|