Spaces:
Sleeping
Sleeping
File size: 1,380 Bytes
c4e85f9 35eccef c4e85f9 35eccef c4e85f9 35eccef c70aef4 35eccef 3c79350 35eccef 3c79350 35eccef 3c79350 35eccef 3c79350 35eccef |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
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)
|