HaithamIsmail
commited on
Commit
·
4626d98
1
Parent(s):
cdaaa6f
fixed upload
Browse files
__pycache__/config.cpython-312.pyc
ADDED
|
Binary file (1.52 kB). View file
|
|
|
__pycache__/lancedb_utils.cpython-312.pyc
ADDED
|
Binary file (2.49 kB). View file
|
|
|
__pycache__/prompts.cpython-312.pyc
ADDED
|
Binary file (2.56 kB). View file
|
|
|
__pycache__/utils.cpython-312.pyc
ADDED
|
Binary file (7.22 kB). View file
|
|
|
__pycache__/video_pipeline.cpython-312.pyc
ADDED
|
Binary file (20.1 kB). View file
|
|
|
app.py
CHANGED
|
@@ -11,7 +11,7 @@ import shutil
|
|
| 11 |
from utils import get_text_embedding, sample_from_video, convert_image_to_base64
|
| 12 |
from config import load_config
|
| 13 |
from lancedb_utils import retreive_clip
|
| 14 |
-
|
| 15 |
|
| 16 |
app_config = load_config()
|
| 17 |
langchain_message_history = []
|
|
@@ -629,8 +629,8 @@ with gr.Blocks(title="Video Search Agent", theme=gr.themes.Soft()) as demo:
|
|
| 629 |
original_filename = "uploaded_video.mp4"
|
| 630 |
temp_dir = tempfile.mkdtemp()
|
| 631 |
tmp_path = os.path.join(temp_dir, original_filename)
|
| 632 |
-
|
| 633 |
-
|
| 634 |
|
| 635 |
# Run the video processing pipeline
|
| 636 |
run_pipeline(tmp_path)
|
|
@@ -644,6 +644,7 @@ with gr.Blocks(title="Video Search Agent", theme=gr.themes.Soft()) as demo:
|
|
| 644 |
|
| 645 |
return f"✅ Video analysis complete for '{original_filename}'. You can now search for clips from this video."
|
| 646 |
except Exception as e:
|
|
|
|
| 647 |
return f"❌ Error during video analysis: {str(e)}"
|
| 648 |
|
| 649 |
analyze_btn.click(
|
|
@@ -660,4 +661,5 @@ if __name__ == "__main__":
|
|
| 660 |
demo.launch(
|
| 661 |
server_name="0.0.0.0",
|
| 662 |
server_port=7860,
|
|
|
|
| 663 |
)
|
|
|
|
| 11 |
from utils import get_text_embedding, sample_from_video, convert_image_to_base64
|
| 12 |
from config import load_config
|
| 13 |
from lancedb_utils import retreive_clip
|
| 14 |
+
import traceback
|
| 15 |
|
| 16 |
app_config = load_config()
|
| 17 |
langchain_message_history = []
|
|
|
|
| 629 |
original_filename = "uploaded_video.mp4"
|
| 630 |
temp_dir = tempfile.mkdtemp()
|
| 631 |
tmp_path = os.path.join(temp_dir, original_filename)
|
| 632 |
+
|
| 633 |
+
shutil.copy(file_obj, tmp_path)
|
| 634 |
|
| 635 |
# Run the video processing pipeline
|
| 636 |
run_pipeline(tmp_path)
|
|
|
|
| 644 |
|
| 645 |
return f"✅ Video analysis complete for '{original_filename}'. You can now search for clips from this video."
|
| 646 |
except Exception as e:
|
| 647 |
+
traceback.print_exc()
|
| 648 |
return f"❌ Error during video analysis: {str(e)}"
|
| 649 |
|
| 650 |
analyze_btn.click(
|
|
|
|
| 661 |
demo.launch(
|
| 662 |
server_name="0.0.0.0",
|
| 663 |
server_port=7860,
|
| 664 |
+
debug=True
|
| 665 |
)
|