NeeravS's picture
Update app.py
3c79350 verified
raw
history blame
1.38 kB
import streamlit as st
import os
from git import Repo
import sys
# GitHub Repository and Directory Setup
repo_url = st.secrets["REPO_URL"] # The private repository URL
github_token = st.secrets["GITHUB_PAT"] # GitHub Personal Access Token
local_dir = "repo"
# Clone the private repository if it doesn't exist locally
if not os.path.exists(local_dir):
try:
repo_url = repo_url.replace("https://", f"https://{github_token}@")
st.write("Cloning the repository...")
Repo.clone_from(repo_url, local_dir)
st.success("Repository cloned successfully!")
except Exception as e:
st.error(f"Error cloning repository: {e}")
# Add the repo directory to the system path
sys.path.insert(0, local_dir)
# Import the necessary module from the cloned repository
try:
from your_video_processing_module import process_video # Replace with your actual module name
except ImportError as e:
st.error(f"Error importing module: {e}")
st.stop() # Stop the app if the module cannot be imported
# Video Summarization Interface
st.title("AI Based Video Summary Tool")
uploaded_video = st.file_uploader("Upload a video", type=["mp4", "avi", "mov"])
if uploaded_video is not None:
st.video(uploaded_video)
# Process the uploaded video
summary = process_video(uploaded_video)
st.write("Video Summary:")
st.write(summary)