File size: 1,583 Bytes
2bab301
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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()