Reframe is a tool for smartly cropping landscape or square videos (e.g., 16:9) and converting them into vertically-oriented, mobile-friendly videos (e.g., 9:16 Shorts, TikToks, and Reels).
Reframe aims to be the definitive open-source solution for accurate and intelligent auto-cropping/reframing of videos. Our goal is to develop a single, robust script that adapts seamlessly to any scenario—be it interviews, group shots, sports, or dynamic action—without requiring users to manually select specific modes or strategies.
Current tools, including industry standards like DaVinci Resolve Studio and Premiere Pro, often struggle with accuracy or are prohibitively expensive and slow. We believe the power of the open-source community can solve this problem, creating a tool that is both accessible and superior in performance.
-
Clone the repository:
git clone https://github.com/halid96/reframe.git cd reframe -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Run a test:
python run_test.py --reframe_scripts_folder_name v1_reframe --challenges_folder_name rishi_interview
- 📍 Location: Create a folder under
/reframe_scriptscontaining your.pyscript and adescription.mdfile. - ⚙️ Technical Requirements:
- CLI Interface: Your script must be runnable from the command line and accept the following arguments:
python script.py <input_video> --output <output_path> --cleanup - Models: Automatically download any required ML models to the
/modelsfolder. Do not commit models to the repo.
- CLI Interface: Your script must be runnable from the command line and accept the following arguments:
- 🏆 Performance Goal: Your script must outperform or match the current best script listed in
/statistics/statistics.md.- 📊 Check
/statistics/statistics.mdto see the current passing rate and which challenges are currently unsolved. - ✨ Your script should ideally solve at least one challenge that the current best script fails.
- 📊 Check
- ✅ Validation: We will review your generated videos against the
criteria.mdin each challenge folder.
- 📍 Location: Create a folder inside
/challenges. - 📦 Contents:
- 📹 A short video file.
- 📝 A
criteria.mdfile describing the expected reframing behavior (e.g., "Keep the person in the center").
You can use the run_test.py script to validate your reframe script against challenges.
Command Syntax:
python run_test.py --reframe_scripts_folder_name <SCRIPT_FOLDER> --challenges_folder_name <CHALLENGE_FOLDER>Examples:
# Run script 'v1_reframe' against challenge 'rishi_interview'
python run_test.py --reframe_scripts_folder_name v1_reframe --challenges_folder_name rishi_interview
# Run script 'v1_reframe' against ALL challenges
python run_test.py --reframe_scripts_folder_name v1_reframe --challenges_folder_name allOptions:
--preview: Show a preview window during processing.
- ⚔️ /challenges: Contains test video clips and criteria for validation.
- 🛠️ /reframe_scripts: Contains reframing scripts.
- 📈 /statistics: Tracks statistics, performance metrics, and passing rates.
- 🎞️ /test_results: Contains tests results, reframed videos.
- 🧠 /models: Directory for ML models.
- 🏃 run_test.py: Main script to run tests and validate performance.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
What this means for you:
- ✅ You can use this software for commercial purposes.
- ✅ You can modify and distribute this software.
- ❗ However, if you use this software (or a modified version of it) as part of a service (e.g., a web app, SaaS, or backend), you must open-source your entire project under the same AGPL-3.0 license.
This requirement is inherited from the Ultralytics YOLO models used in this project.
- Email: halidkyazim@gmail.com