subashpoudel commited on
Commit
27697eb
·
verified ·
1 Parent(s): bc9d06f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -19,11 +19,11 @@ if API_KEY:
19
 
20
  # Page Configuration
21
  st.set_page_config(
22
- page_title="Multimodal AI agent - Video summarizer",
23
  layout="wide"
24
  )
25
 
26
- st.title("Phidata Video Summarizer AI agent")
27
  st.header("Powered by Gemini 2.0 flash exp")
28
 
29
  @st.cache_resource
@@ -53,14 +53,14 @@ def download_tiktok_video(url: str, output_path: str):
53
  return False, str(e)
54
 
55
  # URL input for TikTok video
56
- video_url = st.text_input("Enter TikTok video URL")
57
 
58
  if st.button('Download and Analyze Video'):
59
  if not video_url:
60
  st.warning('PLEASE ENTER A VALID URL')
61
  else:
62
  # Download the TikTok video
63
- with st.spinner("Downloading video..."):
64
  temp_video_path = os.path.join(tempfile.gettempdir(), 'tiktok_video.mp4')
65
  success, message = download_tiktok_video(video_url, temp_video_path)
66
 
@@ -73,7 +73,7 @@ if st.button('Download and Analyze Video'):
73
  st.video(temp_video_path, format="video/mp4", start_time=0)
74
 
75
  try:
76
- with st.spinner("Processing video and gathering insights"):
77
  # Upload and process the video
78
  processed_video = upload_file(temp_video_path)
79
  while processed_video.state.name == "PROCESSING":
@@ -108,6 +108,6 @@ Conclude with a cohesive summary that ties the scenes together, highlighting all
108
  # Delete the downloaded TikTok video
109
  try:
110
  os.remove(temp_video_path)
111
- st.info("Downloaded TikTok video deleted.")
112
  except Exception as e:
113
  st.warning(f"Failed to delete video: {e}")
 
19
 
20
  # Page Configuration
21
  st.set_page_config(
22
+ page_title="Agentic Video Captioning Platform::",
23
  layout="wide"
24
  )
25
 
26
+ st.title("Generate the story of videos:")
27
  st.header("Powered by Gemini 2.0 flash exp")
28
 
29
  @st.cache_resource
 
53
  return False, str(e)
54
 
55
  # URL input for TikTok video
56
+ video_url = st.text_input("Enter TikTok, Twitter or Instagram video URL")
57
 
58
  if st.button('Download and Analyze Video'):
59
  if not video_url:
60
  st.warning('PLEASE ENTER A VALID URL')
61
  else:
62
  # Download the TikTok video
63
+ with st.spinner("Retrieving video..."):
64
  temp_video_path = os.path.join(tempfile.gettempdir(), 'tiktok_video.mp4')
65
  success, message = download_tiktok_video(video_url, temp_video_path)
66
 
 
73
  st.video(temp_video_path, format="video/mp4", start_time=0)
74
 
75
  try:
76
+ with st.spinner("Generating the story of the video"):
77
  # Upload and process the video
78
  processed_video = upload_file(temp_video_path)
79
  while processed_video.state.name == "PROCESSING":
 
108
  # Delete the downloaded TikTok video
109
  try:
110
  os.remove(temp_video_path)
111
+ # st.info("Downloaded TikTok video deleted.")
112
  except Exception as e:
113
  st.warning(f"Failed to delete video: {e}")