Spaces:
Sleeping
Sleeping
Commit
·
2bab301
1
Parent(s):
c06abc6
Upload folder using huggingface_hub
Browse files- .DS_Store +0 -0
- app.py +53 -0
- requirements.txt +8 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
app.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
+
import yfinance as yf
|
| 5 |
+
import altair as alt
|
| 6 |
+
import plotly.figure_factory as ff
|
| 7 |
+
import pydeck as pdk
|
| 8 |
+
from vega_datasets import data as vds
|
| 9 |
+
import plotly.express as px
|
| 10 |
+
import plotly.graph_objects as go
|
| 11 |
+
from plotly.subplots import make_subplots
|
| 12 |
+
from streamlit_image_comparison import image_comparison
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def on_input_change():
|
| 16 |
+
user_input = st.session_state.user_input
|
| 17 |
+
st.session_state.past.append(user_input)
|
| 18 |
+
st.session_state.generated.append(
|
| 19 |
+
{"data": "The messages from Bot\nWith new line", "type": "normal"}
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def on_btn_click():
|
| 24 |
+
del st.session_state.past[:]
|
| 25 |
+
del st.session_state.generated[:]
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def main():
|
| 29 |
+
st.title(" Image Prediction (Computer Vision)")
|
| 30 |
+
option = st.selectbox(" ImageNet / CoCo", [" ImageNet ", " CoCo"])
|
| 31 |
+
value = st.slider(" Threshold", min_value=0, max_value=100, value=50, key=65)
|
| 32 |
+
(
|
| 33 |
+
col1,
|
| 34 |
+
col2,
|
| 35 |
+
) = st.columns(2)
|
| 36 |
+
with col1:
|
| 37 |
+
if st.checkbox(" Remove Noise"):
|
| 38 |
+
st.write("Checkbox checked!")
|
| 39 |
+
with col2:
|
| 40 |
+
if st.checkbox(" Increase Resolution"):
|
| 41 |
+
st.write("Checkbox checked!")
|
| 42 |
+
uploaded_file = st.file_uploader("Choose a file", type=["jpg", "png", "mp3"])
|
| 43 |
+
if st.button(" Predict"):
|
| 44 |
+
st.write("Button clicked!")
|
| 45 |
+
st.subheader(" Original vs Predicted")
|
| 46 |
+
image_comparison(
|
| 47 |
+
img1="https://www.imgonline.com.ua/examples/red-yellow-flower.jpg",
|
| 48 |
+
img2="https://lettatai.sirv.com/imgonline-com-ua-Negative-lYz1br1SWE.jpg",
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
if __name__ == "__main__":
|
| 53 |
+
main()
|
requirements.txt
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
yfinance
|
| 3 |
+
streamlit-chat
|
| 4 |
+
vega_datasets
|
| 5 |
+
streamlit_image_comparison
|
| 6 |
+
plotly==5.14.1
|
| 7 |
+
altair
|
| 8 |
+
pydeck
|