diff --git a/.Jules/palette.md b/.Jules/palette.md index 07928e1..56886f2 100644 --- a/.Jules/palette.md +++ b/.Jules/palette.md @@ -5,3 +5,7 @@ ## 2025-05-18 - Dynamic UI State Context Loss **Learning:** Dynamic DOM section swaps (like hiding a progress bar and showing a completion section) cause loss of context and leave keyboard/screen reader users stranded without an anchor point. **Action:** When dynamically swapping major UI sections, explicitly move focus to a newly revealed heading by adding `tabindex="-1"` and calling `.focus()`. Furthermore, use native ARIA roles (e.g. `role="progressbar"`) and `aria-live="polite"` to ensure progress transitions are accessible. + +## 2025-10-24 - Semantic Radio Button Grouping +**Learning:** Grouping related radio buttons in a generic div with a generic label deprives screen reader users of structural context for the choices. +**Action:** Always group related radio buttons using a fieldset element with a legend, utilizing inline CSS (e.g., border: none; padding: 0;) to preserve visual design while enforcing semantic grouping. diff --git a/background_remover.py b/background_remover.py index a55c856..e07b890 100644 --- a/background_remover.py +++ b/background_remover.py @@ -6,7 +6,6 @@ import torch import cv2 import numpy as np -from moviepy.editor import VideoFileClip # Configure logging logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') @@ -51,7 +50,7 @@ def reporthook(count, block_size, total_size): if count * block_size < total_size: print(f"\rDownloading: {percent}%", end='', flush=True) else: - print(f"\rDownloading: 100%") + print("\rDownloading: 100%") urllib.request.urlretrieve(url, model_path, reporthook=reporthook) logging.info(f"Model downloaded to {model_path}") @@ -457,7 +456,7 @@ def remove_background( # Replace the video-only output with the version that has audio final_output = output_path if bg_color is not None else output_path_temp os.replace(temp_with_audio, final_output) - logging.info(f"Audio merged successfully") + logging.info("Audio merged successfully") else: logging.warning(f"Could not merge audio (video may have no audio track): {result.stderr}") # Clean up temp file diff --git a/create_test_video.py b/create_test_video.py index 9b9389f..42dabc0 100644 --- a/create_test_video.py +++ b/create_test_video.py @@ -1,7 +1,6 @@ import numpy as np import moviepy.editor as mp from moviepy.audio.AudioClip import AudioArrayClip -import os def create_tone(duration, freq=440, volume=0.5, fps=44100): diff --git a/processor.py b/processor.py index 1ff5c1b..9ece76b 100644 --- a/processor.py +++ b/processor.py @@ -272,7 +272,6 @@ def extract_segments_ffmpeg(input_path: str, segments: List[Tuple[float, float]] List of paths to extracted segment files """ import subprocess - import tempfile segment_files = [] diff --git a/web_app/run.py b/web_app/run.py index 6d017f1..1390261 100644 --- a/web_app/run.py +++ b/web_app/run.py @@ -6,7 +6,6 @@ if __name__ == '__main__': import os - import sys # Ensure we're in the right directory script_dir = os.path.dirname(os.path.abspath(__file__)) @@ -18,7 +17,7 @@ print("=" * 60) print("Auto Video Editor - Web Interface") print("=" * 60) - print(f"Starting server on http://localhost:5000") + print("Starting server on http://localhost:5000") print("Press CTRL+C to stop") print("=" * 60) diff --git a/web_app/swagger.py b/web_app/swagger.py index 72fcac9..ddc7636 100644 --- a/web_app/swagger.py +++ b/web_app/swagger.py @@ -1,4 +1,4 @@ -from flask import Blueprint, jsonify +from flask import Blueprint from flask_swagger_ui import get_swaggerui_blueprint swagger_bp = Blueprint('swagger', __name__) diff --git a/web_app/templates/index.html b/web_app/templates/index.html index 7b2abb2..5d21b41 100644 --- a/web_app/templates/index.html +++ b/web_app/templates/index.html @@ -121,8 +121,8 @@

Processing Options

-
- +
+ Background Removal Method
-
+