File size: 2,061 Bytes
47acebd
e153571
3b6c254
 
 
f0a1f4f
3b6c254
f0a1f4f
 
e153571
fd45eb4
 
 
 
 
 
 
 
f0a1f4f
 
 
fd45eb4
f0a1f4f
 
 
 
 
 
 
 
47acebd
f0a1f4f
 
 
 
 
47acebd
 
 
 
 
 
 
 
 
 
fd45eb4
64ca07f
fd45eb4
 
 
 
 
 
3b6c254
 
f0a1f4f
 
 
 
 
 
fd45eb4
 
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import os
import streamlit as st
from Pages.createVisual import CREATEVISUALS
from Pages.AboutMe import ABOUTUS
from Pages.bgImages import BGIMAGES
from Pages.createdVisuals import CREATEDIMAGES
from Pages.createVideo import CREATEGIF
from Pages.objectRecognize import DETECTIMAGE
from Pages.adScript import CREATEAD


st.set_page_config(
        page_title="LumiereIQ",
        page_icon="📸",
        layout="wide",  # 'centered' or 'wide'
        initial_sidebar_state="expanded"  # 'auto', 'expanded', 'collapsed'
    )

def MAIN():
    weights_dir = 'weights'
    weights_file = os.path.join(weights_dir, 'sam_vit_h_4b8939.pth')

    # Check if the weights file already exists
    if not os.path.exists(weights_file):
        # Create the directory if it doesn't exist
        if not os.path.exists(weights_dir):
            os.makedirs(weights_dir)
        
        # Define the download command
        download_command = f"wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -P {weights_dir}"

        # Execute the download command
        os.system(download_command)
        print("Weights downloaded.")
    else:
        print("Weights file already exists. No download needed.")

    # Verify the file is downloaded
    file_path = os.path.expanduser("~/weights/sam_vit_h_4b8939.pth")
    if os.path.exists(file_path):
        print("File downloaded successfully.")
    else:
        print("File download failed.")

    # Rest of your application code

    st.sidebar.title('LumiereIQ')
    app = st.sidebar.selectbox('', ['Create Visuals','Background Images','Recognize Object', 'Create Script', 'Created Images','Create Video'])
    if app == "Create Visuals":
        CREATEVISUALS()
    elif app == "About Me":
        ABOUTUS()
    elif app == "Background Images":
        BGIMAGES()
    elif app == "Create Video":
        CREATEGIF()
    elif app == "Created Images":
        CREATEDIMAGES()
    elif app == "Recognize Object":
        DETECTIMAGE()
    elif app == "Create Script":
        CREATEAD()
          
MAIN()