feat(app): add new preset video and refine comparison flow

This commit is contained in:
game-loader
2025-06-22 11:36:55 +08:00
parent 9d42c8c0eb
commit 899c85ab8f
2 changed files with 33 additions and 21 deletions

View File

@@ -36,7 +36,7 @@ class MotionComparisonApp:
st.session_state.comparison_state = {'is_running': False, 'should_stop': False, 'should_restart': False}
def get_display_resolution(self):
modes = {'high': (1280, 800), 'medium': (960, 720), 'low': (640, 480)}
modes = {'high': (1024, 576), 'medium': (960, 720), 'low': (640, 480)}
mode = self.display_settings.get('resolution_mode', 'medium')
return modes.get(mode, (960, 720))
@@ -74,6 +74,7 @@ class MotionComparisonApp:
try:
self.webcam_cap = cv2.VideoCapture(0)
if self.webcam_cap.isOpened():
self.webcam_cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))
width, height = self.get_display_resolution()
self.webcam_cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
self.webcam_cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)