fix scaling 1

This commit is contained in:
2025-07-26 18:31:16 -07:00
parent d6d2b0aa93
commit 277d554ecc

View File

@@ -1025,7 +1025,21 @@ class VideoProcessor:
print(f"\nProcessing chunk {chunk_idx}: frames {start_frame}-{end_frame}")
# Read chunk frames at dual resolution
# Choose processing approach based on scale factor
if self.config.processing.scale_factor == 1.0:
# No scaling needed - use original single-resolution approach
print(f"🔄 Reading frames at original resolution (no scaling)")
frames = self.read_video_frames(
self.config.input.video_path,
start_frame=start_frame,
num_frames=frames_to_read,
scale_factor=1.0
)
# Process chunk normally (single resolution)
matted_frames = self.process_chunk(frames, chunk_idx)
else:
# Scaling required - use dual-resolution approach
print(f"🔄 Reading frames at dual resolution (scale_factor={self.config.processing.scale_factor})")
frame_data = self.read_video_frames_dual_resolution(
self.config.input.video_path,
@@ -1050,6 +1064,9 @@ class VideoProcessor:
# Free the frames from memory immediately
del matted_frames
if self.config.processing.scale_factor == 1.0:
del frames
else:
del frame_data
# Update statistics