Spaces:
Runtime error
Runtime error
Create backup1.app.py
Browse files- backup1.app.py +152 -0
backup1.app.py
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import os
|
3 |
+
from PIL import Image
|
4 |
+
|
5 |
+
# Placeholder function for Wikipedia content fetching
|
6 |
+
# You'll need to replace this with actual fetching logic
|
7 |
+
def fetch_wikipedia_summary(keyword):
|
8 |
+
# Placeholder text, replace with actual Wikipedia fetching logic
|
9 |
+
return f"Summary about {keyword} from Wikipedia."
|
10 |
+
|
11 |
+
# Display images from the current directory and fetch related Wikipedia stories
|
12 |
+
def display_images_and_wikipedia_summaries():
|
13 |
+
st.title('Gallery with Related Stories')
|
14 |
+
|
15 |
+
# Scan current directory for PNG images
|
16 |
+
image_files = [f for f in os.listdir('.') if f.endswith('.png')]
|
17 |
+
|
18 |
+
# Check if there are any PNG images
|
19 |
+
if not image_files:
|
20 |
+
st.write("No PNG images found in the current directory.")
|
21 |
+
return
|
22 |
+
|
23 |
+
# Iterate over found images
|
24 |
+
for image_file in image_files:
|
25 |
+
# Open and display each image
|
26 |
+
image = Image.open(image_file)
|
27 |
+
st.image(image, caption=image_file, use_column_width='always')
|
28 |
+
|
29 |
+
# Extract a keyword from the image file name for Wikipedia search
|
30 |
+
# This is a simple example; adjust logic as needed for more complex titles
|
31 |
+
keyword = image_file.split('.')[0] # Assumes keyword is the file name without extension
|
32 |
+
|
33 |
+
# Fetch and display related Wikipedia content
|
34 |
+
wikipedia_summary = fetch_wikipedia_summary(keyword)
|
35 |
+
st.write(wikipedia_summary)
|
36 |
+
|
37 |
+
# Call the function to display images and summaries
|
38 |
+
display_images_and_wikipedia_summaries()
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
import streamlit as st
|
43 |
+
st.markdown('# Three Dragons ๐๐ Mythical Dragons Around the World by Aaron Wacker')
|
44 |
+
|
45 |
+
dragons = {
|
46 |
+
'#Fafnir #Norse': '- **Story**: Fafnir originally a dwarf, transformed into a fierce dragon due to his greed for the treasure he guarded. He was later slain by the hero Sigurd. - **Significance**: deadly sin of greed and the corrupting power of wealth.',
|
47 |
+
'#Quetzalcoatl #Aztec': '- **Story**: Quetzalcoatl, the Feathered Serpent, is not a dragon in the traditional sense but shares many similarities. He was a deity representing wind, air, and learning. - **Significance**: creator god and a symbol of death and rebirth.',
|
48 |
+
'#Tiamat #Mesopotamian': '- **Story**: Tiamat, primordial goddess of ocean, turned into a dragon-like creature in a battle against her children who threatened her authority. - **Significance**: chaos of primordial creation and is often associated with the forces of nature.'
|
49 |
+
}
|
50 |
+
|
51 |
+
for dragon, story in dragons.items():
|
52 |
+
st.subheader(dragon)
|
53 |
+
st.markdown(f"- {story}")
|
54 |
+
|
55 |
+
|
56 |
+
st.markdown('''
|
57 |
+
https://github.com/AaronCWacker/ThreeDragons
|
58 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/vkNh6XnEtGSj8mXea1W6p.png)
|
59 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/Kr_nqtaglHE_aiFxWH9zF.png)
|
60 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/WLRKWqB6dKlMH6saVV9cX.png)
|
61 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/Lyazf6FuX4nH__4illVki.png)
|
62 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/ZemsxlT3b5idB0W5IjL1o.png)
|
63 |
+
''')
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
st.markdown('''
|
68 |
+
# Remixable!!
|
69 |
+
## Classifications''')
|
70 |
+
|
71 |
+
# Create three columns for Inputs, Outputs, and Health
|
72 |
+
col1, col2, col3 = st.columns(3)
|
73 |
+
|
74 |
+
with col1:
|
75 |
+
st.markdown('''### Inputs''')
|
76 |
+
st.button("๐ Text")
|
77 |
+
st.button("๐ Read")
|
78 |
+
st.button("๐ท Photo")
|
79 |
+
st.button("๐ผ๏ธ View")
|
80 |
+
st.button("๐๏ธ Record")
|
81 |
+
st.button("๐ง Listen")
|
82 |
+
st.button("๐ฅ Video")
|
83 |
+
st.button("๐น Capture")
|
84 |
+
|
85 |
+
with col2:
|
86 |
+
st.markdown('''### Outputs''')
|
87 |
+
st.button("๐ฌ Chat")
|
88 |
+
st.button("โ๏ธ Write")
|
89 |
+
st.button("๐จ Art")
|
90 |
+
st.button("๐ Create")
|
91 |
+
st.button("๐ต Music")
|
92 |
+
st.button("๐ถ Compose")
|
93 |
+
st.button("๐ผ Watch")
|
94 |
+
st.button("๐ฟ Movies")
|
95 |
+
|
96 |
+
with col3:
|
97 |
+
st.markdown('''### Health''')
|
98 |
+
st.button("๐ Vaccinate")
|
99 |
+
st.button("๐ฉบ Diagnose")
|
100 |
+
st.button("๐ฅ Hospital")
|
101 |
+
st.button("๐ Emergency")
|
102 |
+
st.button("๐ Meds")
|
103 |
+
st.button("๐ฉน Bandage")
|
104 |
+
st.button("๐งฌ DNA")
|
105 |
+
st.button("๐ฌ Research")
|
106 |
+
st.button("๐ก๏ธ Temperature")
|
107 |
+
st.button("๐ Nutrition")
|
108 |
+
|
109 |
+
# Create another set of three columns for Learning, AI, and Writing
|
110 |
+
col4, col5, col6 = st.columns(3)
|
111 |
+
|
112 |
+
with col4:
|
113 |
+
st.markdown('''### Learning''')
|
114 |
+
st.button("๐ Study")
|
115 |
+
st.button("๐ง Brain")
|
116 |
+
st.button("๐ฉโ๐ Graduate")
|
117 |
+
st.button("๐ Measure")
|
118 |
+
st.button("๐ Search")
|
119 |
+
st.button("๐ Analyze")
|
120 |
+
st.button("๐ Plan")
|
121 |
+
st.button("๐๏ธ Write")
|
122 |
+
st.button("๐จโ๐ซ Teach")
|
123 |
+
st.button("๐งฉ Puzzle")
|
124 |
+
|
125 |
+
with col5:
|
126 |
+
st.markdown('''### AI''')
|
127 |
+
st.button("๐ค Robot")
|
128 |
+
st.button("๐พ Game")
|
129 |
+
st.button("๐ป Code")
|
130 |
+
st.button("๐งฎ Calculate")
|
131 |
+
st.button("๐ก Connect")
|
132 |
+
st.button("๐ Power")
|
133 |
+
st.button("๐น๏ธ Play")
|
134 |
+
st.button("๐ฅ๏ธ Display")
|
135 |
+
st.button("๐งโ๐ป Develop")
|
136 |
+
st.button("๐จโ๐ฌ Experiment")
|
137 |
+
|
138 |
+
with col6:
|
139 |
+
st.markdown('''### Writing''')
|
140 |
+
st.button("โ๏ธ Author")
|
141 |
+
st.button("๐ Note")
|
142 |
+
st.button("๐๏ธ Pen")
|
143 |
+
st.button("๐๏ธ Sign")
|
144 |
+
st.button("๐ Library")
|
145 |
+
st.button("๐ Bookmark")
|
146 |
+
st.button("๐ Journal")
|
147 |
+
st.button("โ๏ธ Ink")
|
148 |
+
st.button("๐ Scroll")
|
149 |
+
|
150 |
+
# Similarly, create columns for Coding, Remix, Movies, Video, and Audio as needed
|
151 |
+
# You can continue this pattern for organizing the rest of your buttons into columns
|
152 |
+
|