Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,8 @@ import cv2
|
|
5 |
import uuid
|
6 |
import streamlit as st
|
7 |
from google import generativeai as genai
|
8 |
-
import pywhatkit
|
|
|
9 |
|
10 |
# Configure Gemini API
|
11 |
def configure_api():
|
@@ -88,7 +89,8 @@ if "image_path" in st.session_state and st.button("Suggest Hindi Song"):
|
|
88 |
try:
|
89 |
suggested_song = process_image(st.session_state.image_path, model)
|
90 |
st.success(f"🎵 Suggested Hindi Song: {suggested_song}")
|
91 |
-
|
92 |
-
|
|
|
93 |
except Exception as e:
|
94 |
st.error(f"Error: {e}")
|
|
|
5 |
import uuid
|
6 |
import streamlit as st
|
7 |
from google import generativeai as genai
|
8 |
+
# import pywhatkit
|
9 |
+
import urllib.parse
|
10 |
|
11 |
# Configure Gemini API
|
12 |
def configure_api():
|
|
|
89 |
try:
|
90 |
suggested_song = process_image(st.session_state.image_path, model)
|
91 |
st.success(f"🎵 Suggested Hindi Song: {suggested_song}")
|
92 |
+
search_query = urllib.parse.quote_plus(suggested_song + " song")
|
93 |
+
youtube_link = f"https://www.youtube.com/results?search_query={search_query}"
|
94 |
+
st.markdown(f"[🔗 Click to search on YouTube]({youtube_link})", unsafe_allow_html=True)
|
95 |
except Exception as e:
|
96 |
st.error(f"Error: {e}")
|