import streamlit as st import numpy as np from PIL import Image def main(): st.title("Haltmann Diffusion Algorithm") slider = st.slider("Slider", 0, 255, 128) # default value=128, min=0, max=255 st.title("Haltmann Diffusion Algorithm [C] 20XX ") import streamlit as st from PIL import Image import numpy as np def inpaint(img, mask): """Inpaints the given image using the given mask. Args: img: The image to inpaint. Must be a 3-channel RGB image. mask: The inpainting mask. Must be a binary 3-channel image with 1s indicating the area to inpaint and 0s indicating the area to leave unchanged. Returns: The inpainted image as a 3-channel RGB numpy array. """ ## V0.2 import streamlit as st import numpy as np from PIL import Image import requests import io st.set_option('deprecation.showfileUploaderEncoding', False) @st.cache(allow_output_mutation=True) def load_image(img): im = Image.open(img) return im def main(): st.title("Dall-E Flow") uploaded_file = st.file_uploader("Choose an image", type="jpg") st.markdown("Create images from textual descriptions with Dall-E!") st.button("Edit Photo") ## [C] Haltmann Earth Divison import streamlit as st import numpy as np from PIL import Image, ImageDraw from inpainting import HaltmannInpainter st.set_option('deprecation.showfileUploaderEncoding', False) def main(): # Load the image and initialize the inpainter. image = st.file_uploader("Choose an image", type=["png", "jpg"]) if image is not None: inpainter = HaltmannInpainter() # Get the dimensions of the uploaded image. width, height = Image.open(image).size # Resize the uploaded image if it is too large for our model (> 512x512). if width > 512 or height > 512: max_dim = max(width, height) resize_factor = 512 / max_dim width, height = int(width * resize_factor), int(height * resize_factor) @st.cache def load_image(image): image = np.array(Image.open(image)) return image # Inpaint!