BlendMMM commited on
Commit
89eaeae
·
verified ·
1 Parent(s): 67244d9

Upload 14 files

Browse files
Home.py ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import os
4
+ import base64
5
+ from pathlib import Path
6
+ import streamlit as st
7
+ import os
8
+ from PIL import Image
9
+
10
+
11
+ # path = os.path.dirname(__file__)
12
+ # file_ = open(f"{path}/logo.png", "rb")
13
+ # contents = file_.read()
14
+ # data_url = base64.b64encode(contents).decode("utf-8")
15
+ # file_.close()
16
+
17
+ # def load_local_css(file_name):
18
+ # with open(file_name) as f:
19
+ # st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
20
+
21
+ # def set_header():
22
+ # return st.markdown(
23
+ # f"""<div class='main-header'>
24
+ # <h1>Synthetic Control</h1>
25
+ # <img src="data:image;base64,{data_url}", alt="Logo">
26
+ # </div>""",
27
+ # unsafe_allow_html=True,
28
+ # )
29
+
30
+
31
+ st.set_page_config()
32
+ # load_local_css("styles.css")
33
+ # set_header()
34
+
35
+ st.title("The Art of Words: Vachana's Collection")
36
+
37
+
38
+ def load_images_from_folder(folder_path):
39
+ """
40
+ Load all images from the specified folder and store them in a dictionary.
41
+
42
+ Args:
43
+ folder_path (str): Path to the folder containing images.
44
+
45
+ Returns:
46
+ dict: A dictionary with image filenames as keys and PIL Image objects as values.
47
+ """
48
+ images_dict = {}
49
+ try:
50
+ for filename in os.listdir(folder_path):
51
+ if filename.lower().endswith(('.png', '.jpg', '.jpeg', '.gif', '.bmp')):
52
+ img_path = os.path.join(folder_path, filename)
53
+ images_dict[filename] = Image.open(img_path)
54
+ except Exception as e:
55
+ st.error(f"Error loading images: {e}")
56
+ return images_dict
57
+
58
+
59
+ # Folder selection
60
+ with st.expander("Click to Discover the Masterpiece"):
61
+ folder_path = 'Photos'
62
+ def load_images_from_folder(folder_path, target_size=(200, 200)):
63
+ """
64
+ Load all images from the specified folder, resize them to a uniform size, and store them in a dictionary.
65
+
66
+ Args:
67
+ folder_path (str): Path to the folder containing images.
68
+ target_size (tuple): Desired size for all images (width, height).
69
+
70
+ Returns:
71
+ dict: A dictionary with image filenames as keys and resized PIL Image objects as values.
72
+ """
73
+ images_dict = {}
74
+ try:
75
+ for filename in os.listdir(folder_path):
76
+ if filename.lower().endswith(('.png', '.jpg', '.jpeg', '.gif', '.bmp')):
77
+ img_path = os.path.join(folder_path, filename)
78
+ img = Image.open(img_path).convert("RGB") # Convert to RGB for consistency
79
+ img = img.resize(target_size) # Resize image
80
+ images_dict[filename] = img
81
+ except Exception as e:
82
+ st.error(f"Error loading images: {e}")
83
+ return images_dict
84
+
85
+ # Streamlit UI
86
+ if folder_path:
87
+ if not os.path.exists(folder_path):
88
+ st.error("The specified folder path does not exist. Please enter a valid path.")
89
+ else:
90
+ # Load images
91
+ images = load_images_from_folder(folder_path, target_size=(300, 400)) # Set desired size
92
+
93
+ if images:
94
+
95
+ # Display images side by side with a row break
96
+ cols_per_row = 3 # Adjust the number of images displayed per row
97
+ images_list = list(images.items())
98
+
99
+ for i in range(0, len(images_list), cols_per_row):
100
+ cols = st.columns(cols_per_row)
101
+ for col, (img_name, img) in zip(cols, images_list[i:i + cols_per_row]):
102
+ with col:
103
+
104
+ st.image(img, use_column_width=True)
105
+
106
+ # Add a break after each row
107
+ st.divider() # Simple divider
108
+ else:
109
+ st.warning("No images found in the specified folder.")
110
+ else:
111
+ st.info("Please enter a folder path to load and display images.")
112
+
113
+
114
+
Photos/WhatsApp Image 2024-12-24 at 10.16.31 AM.jpeg ADDED
Photos/WhatsApp Image 2024-12-24 at 10.22.57 AM.jpeg ADDED
Photos/WhatsApp Image 2024-12-24 at 10.23.17 AM.jpeg ADDED
Photos/WhatsApp Image 2024-12-24 at 10.28.42 AM.jpeg ADDED
Photos/WhatsApp Image 2024-12-24 at 5.18.58 PM.jpeg ADDED
Photos/WhatsApp Image 2024-12-24 at 5.18.59 PM.jpeg ADDED
Photos/WhatsApp Image 2024-12-24 at 5.19.00 PM.jpeg ADDED
Photos/WhatsApp Image 2024-12-24 at 5.19.01 PM.jpeg ADDED
Photos/WhatsApp Image 2024-12-24.jpeg ADDED
README.md CHANGED
@@ -1,12 +1,12 @@
1
- ---
2
- title: Vachana
3
- emoji: 📈
4
- colorFrom: blue
5
- colorTo: red
6
- sdk: streamlit
7
- sdk_version: 1.41.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ ---
2
+ title: SCM
3
+ emoji: 👀
4
+ colorFrom: indigo
5
+ colorTo: yellow
6
+ sdk: streamlit
7
+ sdk_version: 1.40.0
8
+ app_file: Home.py
9
+ pinned: false
10
+ ---
11
+
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
logo.png ADDED
requirements.txt ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dash==2.9.3
2
+ dash_auth==2.0.0
3
+ dash_bootstrap_components==1.4.1
4
+ holidays==0.24
5
+ hyperopt==0.2.7
6
+ joblib==1.2.0
7
+ matplotlib==3.5.1
8
+ mdutils==1.5.0
9
+ numpy==1.22.4
10
+ openpyxl==3.0.10
11
+ openpyxl_image_loader==1.0.5
12
+ pandas==1.5.2
13
+ # Pillow==9.4.0
14
+ Pillow==10.2.0
15
+ plotly==5.14.1
16
+ pmdarima==2.0.2
17
+ prophet==1.1.2
18
+ python-dotenv==1.0.0
19
+ # pytz==2022.7.1
20
+ pytz==2022.7
21
+ scikit_learn==1.2.2
22
+ scipy==1.7.3
23
+ seaborn==0.11.2
24
+ shap==0.41.0
25
+ statsmodels==0.13.5
26
+ streamlit==1.27.2
27
+ streamlit-aggrid==0.3.4.post3
28
+ sweetviz==2.3.1
29
+ waitress==2.1.2
30
+ xgboost==1.6.2
styles.css ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ html {
2
+ margin: 0;
3
+ }
4
+
5
+ #MainMenu {
6
+
7
+ visibility: collapse;
8
+ }
9
+
10
+ footer {
11
+ visibility: collapse;
12
+ }
13
+
14
+ div.block-container{
15
+ padding: 2rem 3rem;
16
+ }
17
+
18
+
19
+ .main-header {
20
+ display: flex;
21
+ flex-direction: row;
22
+ justify-content: space-between;
23
+ align-items: center;
24
+ }
25
+ .main-header > img {
26
+ max-height: 96px;
27
+ /* max-width: 300px; */
28
+ object-fit: cover;
29
+ }
30
+
31
+
32
+
33
+ button div {
34
+ overflow: hidden;
35
+ text-overflow:ellipsis;
36
+ white-space: nowrap;
37
+ }
38
+
39
+
40
+
41
+ h1 {
42
+ color: #053057;
43
+ }
44
+
45
+ hr {
46
+ height: 10px !important;
47
+ color: #053057;
48
+ }
49
+
50
+ p.plot-header {
51
+ font-size: small;
52
+ font-weight: bold;
53
+ }
54
+
55
+ hr {
56
+ margin: 0 0 10 0;
57
+ padding: 0;
58
+ }