Spaces:
Running
Running
samcoding5854
commited on
Commit
•
fd45eb4
1
Parent(s):
e153571
BGImages code
Browse files- .gitignore +1 -0
- App/AboutMe.py +61 -0
- App/__pycache__/AboutMe.cpython-310.pyc +0 -0
- App/__pycache__/bgImages.cpython-310.pyc +0 -0
- App/__pycache__/createVisual.cpython-310.pyc +0 -0
- App/bgImages.py +78 -0
- App/createVisual.py +12 -0
- App/utils.py +0 -0
- app.py +24 -2
- bgImages/1.jpg +0 -0
- bgImages/2.jpg +0 -0
- bgImages/3.jpg +0 -0
- bgImages/4.jpg +0 -0
- requirements.txt +3 -1
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.streamlit
|
App/AboutMe.py
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
def ABOUTUS():
|
4 |
+
st.title('About Us')
|
5 |
+
st.write("""
|
6 |
+
Welcome to our Streamlit app! We are a team of developers passionate about creating
|
7 |
+
innovative solutions using Streamlit.
|
8 |
+
""")
|
9 |
+
|
10 |
+
# Project description
|
11 |
+
project_description = """
|
12 |
+
**Project Title: Detective Mastermind**
|
13 |
+
|
14 |
+
**Description:**
|
15 |
+
Detective Mastermind is an interactive murder mystery game that immerses players in a captivating storyline filled with suspense and intrigue. Through a combination of storytelling and gameplay mechanics, players become detectives tasked with solving a complex homicide case. Key features include:
|
16 |
+
|
17 |
+
- **Engaging Narrative:** Dive into a gripping storyline filled with twists and turns, driven by vivid descriptions and character interactions.
|
18 |
+
- **Dynamic Suspects:** Investigate a cast of unique suspects, each with their own motives, alibis, and relationships with the victim.
|
19 |
+
- **Progressive Hint System:** Receive subtle hints to guide the investigation without giving away the solution, encouraging critical thinking and deduction.
|
20 |
+
- **Interactive Gameplay:** Explore crime scenes, gather evidence, and interview suspects through interactive elements such as multiple-choice questions and decision-making scenarios.
|
21 |
+
- **Stable Diffusion Integration:** Visualize the crime scene with lifelike images generated using Stable Diffusion technology, enhancing the immersive experience.
|
22 |
+
|
23 |
+
**Objective:**
|
24 |
+
Challenge your problem-solving skills and analytical thinking as you unravel the mystery behind the murder. Piece together clues, examine evidence, and make informed decisions to identify the culprit and bring them to justice.
|
25 |
+
|
26 |
+
**Audience:**
|
27 |
+
Designed for players who enjoy solving puzzles and engaging in immersive storytelling, Detective Mastermind appeals to a broad audience of casual gamers and mystery enthusiasts.
|
28 |
+
|
29 |
+
**Platform:**
|
30 |
+
Accessible as a web-based application on desktop and mobile devices, Detective Mastermind offers seamless gameplay across various platforms with a user-friendly interface and intuitive controls.
|
31 |
+
|
32 |
+
**Conclusion:**
|
33 |
+
Prepare to embark on a thrilling journey filled with mystery and suspense in Detective Mastermind. Whether you're a novice detective or a seasoned sleuth, test your investigative skills and uncover the truth behind the murder in this immersive murder mystery game.
|
34 |
+
"""
|
35 |
+
|
36 |
+
# Display project description
|
37 |
+
st.title("Detective Mastermind: Solve the Murder Mystery")
|
38 |
+
st.image('App/logo.jpg', caption='Our Logo', width = 400)
|
39 |
+
st.write(project_description)
|
40 |
+
|
41 |
+
|
42 |
+
st.subheader('Team Members')
|
43 |
+
st.write("""
|
44 |
+
Meet the minds behind this project:
|
45 |
+
""")
|
46 |
+
|
47 |
+
# Member 1
|
48 |
+
st.write("*Darsh Baxi*")
|
49 |
+
st.image('App/darsh.jpg', width=200)
|
50 |
+
st.write("GitHub: [Darsh Baxi](https://github.com/darshbaxi)")
|
51 |
+
st.write("LinkedIn: [Darsh Baxi](https://www.linkedin.com/in/darsh-baxi-81350124a/)")
|
52 |
+
|
53 |
+
# Member 2
|
54 |
+
st.write("*Samarth Sahu*")
|
55 |
+
st.image('App/samarth.jpg', width=200)
|
56 |
+
st.write("GitHub: [Samarth Sahu](https://github.com/Samcoding5854/)")
|
57 |
+
st.write("LinkedIn: [Samarth Sahu](https://www.linkedin.com/in/samarth-sahu/)")
|
58 |
+
|
59 |
+
st.write("""
|
60 |
+
Feel free to explore our app and reach out to us for any questions or feedback!
|
61 |
+
""")
|
App/__pycache__/AboutMe.cpython-310.pyc
ADDED
Binary file (3.4 kB). View file
|
|
App/__pycache__/bgImages.cpython-310.pyc
ADDED
Binary file (1.98 kB). View file
|
|
App/__pycache__/createVisual.cpython-310.pyc
ADDED
Binary file (396 Bytes). View file
|
|
App/bgImages.py
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
from diffusers import AutoPipelineForText2Image
|
3 |
+
from PIL import Image
|
4 |
+
import os
|
5 |
+
import streamlit as st
|
6 |
+
|
7 |
+
def load_images_from_folder(folder):
|
8 |
+
images = []
|
9 |
+
for filename in os.listdir(folder):
|
10 |
+
if filename.endswith(".jpg") or filename.endswith(".png"):
|
11 |
+
images.append(os.path.join(folder, filename))
|
12 |
+
return images
|
13 |
+
|
14 |
+
|
15 |
+
# Main function
|
16 |
+
def BGIMAGES():
|
17 |
+
st.title("Background Images")
|
18 |
+
|
19 |
+
st.header('Create a template', divider='orange')
|
20 |
+
|
21 |
+
prompt = st.text_input("Movie title")
|
22 |
+
if prompt:
|
23 |
+
# Load the pipeline
|
24 |
+
with st.spinner("Loading model..."):
|
25 |
+
pipeline = AutoPipelineForText2Image.from_pretrained(
|
26 |
+
"stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, variant="fp16"
|
27 |
+
).to("cuda")
|
28 |
+
|
29 |
+
# Set the generator seed
|
30 |
+
generator = torch.Generator("cuda").manual_seed(31)
|
31 |
+
|
32 |
+
# Generate the image
|
33 |
+
with st.spinner("Generating image..."):
|
34 |
+
image_prompt = f"{prompt}, Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
|
35 |
+
image = pipeline(image_prompt, generator=generator).images[0]
|
36 |
+
|
37 |
+
# Save the image
|
38 |
+
output_dir = "bgImages"
|
39 |
+
os.makedirs(output_dir, exist_ok=True)
|
40 |
+
image_path = os.path.join(output_dir, f"{prompt}.png")
|
41 |
+
image.save(image_path)
|
42 |
+
|
43 |
+
# Display the image
|
44 |
+
st.image(image, caption=f"Generated image for: {prompt}")
|
45 |
+
|
46 |
+
else:
|
47 |
+
st.write("Please enter a movie title to generate an image.")
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
# Path to the folder containing images
|
52 |
+
image_folder = "bgImages"
|
53 |
+
|
54 |
+
# Load images from the folder
|
55 |
+
images = load_images_from_folder(image_folder)
|
56 |
+
|
57 |
+
# Display images and information in a grid layout with three images per row
|
58 |
+
col_width = 350 # Adjust this value according to your preference
|
59 |
+
num_images = len(images)
|
60 |
+
images_per_row = 3
|
61 |
+
num_rows = (num_images + images_per_row - 1) // images_per_row
|
62 |
+
|
63 |
+
st.header('Available Templates', divider = 'red')
|
64 |
+
|
65 |
+
# Display images and information in a grid layout with three images per row
|
66 |
+
for i in range(num_rows):
|
67 |
+
cols = st.columns(images_per_row)
|
68 |
+
for j in range(images_per_row):
|
69 |
+
idx = i * images_per_row + j
|
70 |
+
if idx < num_images:
|
71 |
+
cols[j].image(images[idx], width=col_width)
|
72 |
+
cols[j].write(images[idx])
|
73 |
+
|
74 |
+
|
75 |
+
if __name__ == "__main__":
|
76 |
+
BGIMAGES()
|
77 |
+
|
78 |
+
|
App/createVisual.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
# Main function
|
4 |
+
def CREATEVISUALS():
|
5 |
+
st.title("Detective Game")
|
6 |
+
st.write("Hey how are you")
|
7 |
+
|
8 |
+
|
9 |
+
if __name__ == "__main__":
|
10 |
+
CREATEVISUALS()
|
11 |
+
|
12 |
+
|
App/utils.py
ADDED
File without changes
|
app.py
CHANGED
@@ -1,4 +1,26 @@
|
|
1 |
import streamlit as st
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
from App.createVisual import CREATEVISUALS
|
3 |
+
from App.AboutMe import ABOUTUS
|
4 |
+
from App.bgImages import BGIMAGES
|
5 |
|
6 |
+
|
7 |
+
st.set_page_config(
|
8 |
+
page_title="LumiereIQ",
|
9 |
+
page_icon="📸",
|
10 |
+
layout="wide", # 'centered' or 'wide'
|
11 |
+
initial_sidebar_state="expanded" # 'auto', 'expanded', 'collapsed'
|
12 |
+
)
|
13 |
+
|
14 |
+
|
15 |
+
def MAIN():
|
16 |
+
st.sidebar.title('LumiereIQ')
|
17 |
+
app = st.sidebar.selectbox('', ['Create Visuals','Background Images', 'About Me'])
|
18 |
+
if app == "Create Visuals":
|
19 |
+
CREATEVISUALS()
|
20 |
+
elif app == "About Me":
|
21 |
+
ABOUTUS()
|
22 |
+
elif app == "Background Images":
|
23 |
+
BGIMAGES()
|
24 |
+
|
25 |
+
|
26 |
+
MAIN()
|
bgImages/1.jpg
ADDED
bgImages/2.jpg
ADDED
bgImages/3.jpg
ADDED
bgImages/4.jpg
ADDED
requirements.txt
CHANGED
@@ -1 +1,3 @@
|
|
1 |
-
streamlit
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
diffusers
|
3 |
+
torch
|