Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import streamlit as st
|
2 |
-
from streamlit_drawable_canvas import st_canvas
|
3 |
from huggingface_hub import HfFileSystem
|
4 |
from flax.serialization import msgpack_restore, from_state_dict
|
5 |
|
@@ -18,28 +17,4 @@ print([(k, type(v)) for (k, v) in state.items()])
|
|
18 |
# print(logits)
|
19 |
|
20 |
# x = st.slider('Select a value')
|
21 |
-
# st.write(x, 'squared is', x * x)
|
22 |
-
|
23 |
-
# Specify canvas parameters in application
|
24 |
-
stroke_width = st.sidebar.slider("Stroke width: ", 1, 25, 3)
|
25 |
-
realtime_update = st.sidebar.checkbox("Update in realtime", True)
|
26 |
-
|
27 |
-
# Create a canvas component
|
28 |
-
canvas_result = st_canvas(
|
29 |
-
fill_color="rgb(0, 0, 0)", # Fixed fill color with some opacity
|
30 |
-
stroke_width=stroke_width,
|
31 |
-
stroke_color="rgb(255, 255, 255)",
|
32 |
-
background_color="rgb(0, 0, 0)",
|
33 |
-
background_image=None,
|
34 |
-
update_streamlit=realtime_update,
|
35 |
-
height=28,
|
36 |
-
width=28,
|
37 |
-
drawing_mode="freedraw",
|
38 |
-
point_display_radius=0,
|
39 |
-
display_toolbar=st.sidebar.checkbox("Display toolbar", True),
|
40 |
-
key="full_app",
|
41 |
-
)
|
42 |
-
|
43 |
-
# Do something interesting with the image data and paths
|
44 |
-
if canvas_result.image_data is not None:
|
45 |
-
st.image(canvas_result.image_data)
|
|
|
1 |
import streamlit as st
|
|
|
2 |
from huggingface_hub import HfFileSystem
|
3 |
from flax.serialization import msgpack_restore, from_state_dict
|
4 |
|
|
|
17 |
# print(logits)
|
18 |
|
19 |
# x = st.slider('Select a value')
|
20 |
+
# st.write(x, 'squared is', x * x)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|