Spaces:
Running
Running
import streamlit as st | |
import pandas as pd | |
import numpy as np | |
import yfinance as yf | |
import altair as alt | |
import plotly.figure_factory as ff | |
import pydeck as pdk | |
from vega_datasets import data as vds | |
import plotly.express as px | |
import plotly.graph_objects as go | |
from plotly.subplots import make_subplots | |
from streamlit_image_comparison import image_comparison | |
def on_input_change(): | |
user_input = st.session_state.user_input | |
st.session_state.past.append(user_input) | |
st.session_state.generated.append( | |
{"data": "The messages from Bot\nWith new line", "type": "normal"} | |
) | |
def on_btn_click(): | |
del st.session_state.past[:] | |
del st.session_state.generated[:] | |
def main(): | |
st.title(" Image Prediction (Computer Vision)") | |
option = st.selectbox(" ImageNet / CoCo", [" ImageNet ", " CoCo"]) | |
value = st.slider(" Threshold", min_value=0, max_value=100, value=50, key=65) | |
( | |
col1, | |
col2, | |
) = st.columns(2) | |
with col1: | |
if st.checkbox(" Remove Noise"): | |
st.write("Checkbox checked!") | |
with col2: | |
if st.checkbox(" Increase Resolution"): | |
st.write("Checkbox checked!") | |
uploaded_file = st.file_uploader("Choose a file", type=["jpg", "png", "mp3"]) | |
if st.button(" Predict"): | |
st.write("Button clicked!") | |
st.subheader(" Original vs Predicted") | |
image_comparison( | |
img1="https://www.imgonline.com.ua/examples/red-yellow-flower.jpg", | |
img2="https://lettatai.sirv.com/imgonline-com-ua-Negative-lYz1br1SWE.jpg", | |
) | |
if __name__ == "__main__": | |
main() | |