add displaying info

This commit is contained in:
2026-01-31 16:37:31 +08:00
parent cd40f843db
commit 5c8df5f9d5

View File

@@ -60,6 +60,7 @@ class VideoCleaner:
""" """
Scans the video using YOLO's native stream processing. Scans the video using YOLO's native stream processing.
""" """
print(f"[{os.getpid()}] Analyzing: {video_path.name}", flush=True)
model = self._get_model() model = self._get_model()
# Use YOLO's generator to handle video decoding efficiently # Use YOLO's generator to handle video decoding efficiently
# vid_stride=int(fps*2) could be used but we need consistent logic # vid_stride=int(fps*2) could be used but we need consistent logic
@@ -114,10 +115,10 @@ class VideoCleaner:
keep, reason = self.should_keep_video(video_path, save_preview_path=preview_path) keep, reason = self.should_keep_video(video_path, save_preview_path=preview_path)
if keep: if keep:
print(f"Action: KEEP {video_path.name} - Reason: {reason}") print(f"[{os.getpid()}] Action: KEEP {video_path.name} - Reason: {reason}", flush=True)
self.move_to_processed(video_path, processed_base_dir, input_base_dir) self.move_to_processed(video_path, processed_base_dir, input_base_dir)
else: else:
print(f"Action: DELETE {video_path.name} - Reason: {reason}") print(f"[{os.getpid()}] Action: DELETE {video_path.name} - Reason: {reason}", flush=True)
os.remove(video_path) os.remove(video_path)
return True # 表示处理了 return True # 表示处理了