Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
@@ -11,4 +11,131 @@ hf_oauth: true
|
|
11 |
hf_oauth_scopes:
|
12 |
- email
|
13 |
sdk_version: 1.44.1
|
14 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
hf_oauth_scopes:
|
12 |
- email
|
13 |
sdk_version: 1.44.1
|
14 |
+
---
|
15 |
+
|
16 |
+
# Smart Edit Assistant
|
17 |
+
|
18 |
+
**Smart Edit Assistant** is an AI-powered web application that **automates video editing tasks** end-to-end. Users can upload video files, let the system **extract audio**, **transcribe** the speech (e.g., via Whisper), **analyze** content with GPT-like models, and **apply automated cuts and edits** using FFmpeg or MoviePy. The end result is a curated, shorter (or otherwise improved) video that can be downloaded, saving creators time on manual post-production.
|
19 |
+
|
20 |
+
## Features
|
21 |
+
|
22 |
+
- **Video Upload & Preview**: Upload `.mp4`, `.mov`, or `.mkv` files.
|
23 |
+
- **Audio Extraction**: Efficiently pulls the audio track for transcription.
|
24 |
+
- **AI Transcription**: Uses OpenAI Whisper (API or local) or other STT solutions.
|
25 |
+
- **LLM Content Analysis**: GPT-4 or open-source LLM suggests cuts and highlight segments.
|
26 |
+
- **Automated Editing**: Uses FFmpeg/MoviePy to cut and reassemble segments, optionally insert transitions.
|
27 |
+
- **Result Preview**: Plays the edited video in-browser before download.
|
28 |
+
- **(Optional) User Authentication**: Configurable free vs. premium tiers.
|
29 |
+
|
30 |
+
## Repository Structure
|
31 |
+
|
32 |
+
smart-edit-assistant/ ├── app.py # Main Streamlit app ├── pipelines/ │ ├── video_process.py # Audio extraction & editing logic (MoviePy / FFmpeg) │ ├── ai_inference.py # Whisper/GPT calls for transcription & instructions │ └── auth_utils.py # Optional authentication logic ├── .streamlit/ │ └── config.toml # Streamlit config (upload limit, theming) ├── requirements.txt # Python dependencies ├── apt.txt # (Optional) System-level dependencies if needed └── README.md # Project description (this file)
|
33 |
+
|
34 |
+
bash
|
35 |
+
Copy code
|
36 |
+
|
37 |
+
## Local Development & Setup
|
38 |
+
|
39 |
+
1. **Clone this repo**:
|
40 |
+
```bash
|
41 |
+
git clone https://github.com/YourUsername/smart-edit-assistant.git
|
42 |
+
cd smart-edit-assistant
|
43 |
+
Install Python dependencies:
|
44 |
+
|
45 |
+
bash
|
46 |
+
Copy code
|
47 |
+
pip install -r requirements.txt
|
48 |
+
If you plan to run open-source Whisper locally, ensure you install openai-whisper or the GitHub repo (git+https://github.com/openai/whisper.git).
|
49 |
+
|
50 |
+
If you’re using GPU, make sure your PyTorch install matches your CUDA version.
|
51 |
+
|
52 |
+
Run the app:
|
53 |
+
|
54 |
+
bash
|
55 |
+
Copy code
|
56 |
+
streamlit run app.py
|
57 |
+
Open http://localhost:8501 in your browser to interact with the UI.
|
58 |
+
|
59 |
+
Set Environment Variables (for GPT or Whisper API, if needed):
|
60 |
+
|
61 |
+
bash
|
62 |
+
Copy code
|
63 |
+
export OPENAI_API_KEY="sk-..."
|
64 |
+
or store in a local .env file and load with python-dotenv.
|
65 |
+
|
66 |
+
Deploying on Hugging Face Spaces
|
67 |
+
Create a Space:
|
68 |
+
|
69 |
+
Go to Hugging Face Spaces and create a new Space with the Streamlit SDK option.
|
70 |
+
|
71 |
+
Upload your files:
|
72 |
+
|
73 |
+
Either drag-and-drop via the web interface or push via Git:
|
74 |
+
|
75 |
+
bash
|
76 |
+
Copy code
|
77 |
+
git remote add origin https://huggingface.co/spaces/YourUsername/Smart-Edit-Assistant
|
78 |
+
git push origin main
|
79 |
+
Set your secrets:
|
80 |
+
|
81 |
+
In the Space’s Settings page, add OPENAI_API_KEY or any other API keys under “Secrets”.
|
82 |
+
|
83 |
+
If you want GPU, set hardware: "gpu" in the YAML frontmatter (as shown above) or in the Space settings.
|
84 |
+
|
85 |
+
Build and Launch:
|
86 |
+
|
87 |
+
The Space will automatically install your requirements.txt and run app.py.
|
88 |
+
|
89 |
+
Once deployed, your app is live at https://huggingface.co/spaces/YourUsername/Smart-Edit-Assistant.
|
90 |
+
|
91 |
+
Usage
|
92 |
+
Upload a Video: Click “Browse files” to select a .mp4, .mov, or .mkv file.
|
93 |
+
|
94 |
+
Extract & Transcribe: The app automatically pulls the audio, then uses Whisper or another STT method to get a transcript.
|
95 |
+
|
96 |
+
Generate Edits: An LLM (GPT-4 or local) analyzes the transcript and suggests where to cut or remove filler content.
|
97 |
+
|
98 |
+
Apply Edits: The app runs ffmpeg or MoviePy to create a new edited video file.
|
99 |
+
|
100 |
+
Preview & Download: You can watch the edited clip directly in the browser and then download the .mp4.
|
101 |
+
|
102 |
+
Configuration
|
103 |
+
Streamlit Config:
|
104 |
+
|
105 |
+
.streamlit/config.toml can set maxUploadSize (e.g. 10GB) or color theme.
|
106 |
+
|
107 |
+
Authentication:
|
108 |
+
|
109 |
+
If hf_oauth is true, users must log in with their Hugging Face account.
|
110 |
+
|
111 |
+
For custom username/password or free vs. premium tiers, see auth_utils.py or documentation in your code.
|
112 |
+
|
113 |
+
Roadmap
|
114 |
+
Interactive Timeline: Let users manually tweak the AI’s suggested cuts.
|
115 |
+
|
116 |
+
B-roll Insertion: Generate or fetch recommended B-roll and splice it in automatically.
|
117 |
+
|
118 |
+
Transition Effects: Provide crossfades, text overlays, or AI-generated intros/outros.
|
119 |
+
|
120 |
+
Multi-user Collaboration: Shared editing session or project saving in a database.
|
121 |
+
|
122 |
+
Troubleshooting
|
123 |
+
File Not Found or Zero Bytes: Make sure ffmpeg or MoviePy didn’t fail silently. Check logs for errors.
|
124 |
+
|
125 |
+
Whisper “load_model” Error: Ensure you installed openai-whisper or the GitHub repo, not the unrelated “whisper” PyPI package.
|
126 |
+
|
127 |
+
Large File Upload: If large uploads fail, confirm the maxUploadSize in .streamlit/config.toml is high enough, and verify huggingface secrets/config.
|
128 |
+
|
129 |
+
Performance: For best speed, request a GPU from Hugging Face Spaces or use a local GPU with the correct PyTorch/CUDA version.
|
130 |
+
|
131 |
+
License
|
132 |
+
You can choose a license that suits your project. For example:
|
133 |
+
|
134 |
+
java
|
135 |
+
Copy code
|
136 |
+
MIT License
|
137 |
+
|
138 |
+
Copyright (c) 2025 ...
|
139 |
+
|
140 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
141 |
+
of this software and associated documentation files (the "Software"), ...
|