File size: 1,202 Bytes
bfbb419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
st.set_page_config (page_icon="icon.jpg",page_title="Content Moderation",layout="centered")
# content_type=st.selectbox("Content Type",["Text","Image","Video"])
st.markdown("<h1 style='color: var(--black-100, var(--black-100, #1C1C1C));text-align: center;font-feature-settings: 'cv11' on, 'cv01' on, 'ss01' on;font-family: Poppins;font-size: 48px;font-style: normal;font-weight: 600;line-height: 58px;'>Content Moderation</h1>",
            unsafe_allow_html=True)
c1,c2=st.columns(2)
with c1 :
    content_type=st.selectbox("Content Type",["Text","Image","Video"])
    input=st.text_area(":blue[My text here :]",height=500)
if "Video" in content_type:
    def generate_text(project_id: str, location: str) -> str:
    # Initialize Vertex AI
    # vertexai.init(project=project_id, location=location)
    # Load the model
    # vision_model = GenerativeModel("gemini-pro-vision")
    # Generate text
     response = vision_model.generate_content(
        [
            Part.from_uri(
                "gs://cloud-samples-data/video/animals.mp4", mime_type="video/mp4"
            ),
            "What is in the video?",
        ]
    )
    print(response)
    return response.text