Spaces:
Runtime error
Runtime error
File size: 2,574 Bytes
44df93e 46b1fdf 44df93e 46b1fdf e6e7f9c 44df93e 46b1fdf 44df93e 46b1fdf 44df93e 46b1fdf 44df93e 46b1fdf 44df93e 46b1fdf 44df93e 46b1fdf |
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
import collections
from numpy.core.defchararray import lower
import streamlit as st
import numpy as np
import pandas as pd
import streamlit as st
import pandas as pd
import numpy as np
import os, random, time
from utils import footer, generate, drawGrid
from PIL import Image
mode = "ai"
#mode = "dummy"
def app():
st.title('AI-Generated Architecture')
st.subheader('(beta v1.0)')
st.text('This is a working beta version with bugs. Known issues are:\n-Some images will grey out when you change the input parameters')
st.subheader('Describe a building, interior, or other architecture you would like to see.')
#Modern architecture museum with black brick and large windows.
prompt = st.text_input(label="",value="Modern architecture museum with black brick and large windows.")
st.text("")
with st.expander("Having trouble thinking of something? Click here to view examples."):
st.write("""
• Modern architecture museum with black brick and large windows.\n
• A prosaic, simple architecture.\n
• An urban, post-modern architecture with concrete and steel.\n
• A sleek urban interior design.
""")
st.text("")
crazy = st.slider('Temperature. This controls how "crazy" generated images are, where 0 is the least crazy.', 0.0, 1.0, 0.75)
k = st.slider('Top K. The higher the value, the higher quality the results tend to be at the cost of extra processing time.', 1, 10, 1)
if( 'results' not in st.session_state ):
st.session_state.results = []
holder = st.empty()
startButton = holder.button("Start")
already = []
if startButton or hasattr(st.session_state, 'load_state'):
with st.spinner("Generating..."):
holder.empty()
nextButton = holder.button("finished generating images")
st.session_state.load_state = True
placeholder = st.empty()
second = st.empty()
#with second.container():
# drawGrid()
while len(st.session_state.results) <= 64:
with second.container():
drawGrid()
with placeholder.container():
st.session_state.bar = placeholder.progress(0)
if(nextButton):
st.session_state.page = 1
break
generate( prompt ,crazy,k)
st.session_state.bar = st.container()
|