PrakhAI commited on
Commit
90e0616
·
1 Parent(s): 0565583

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import streamlit as st
 
2
  from huggingface_hub import HfFileSystem
3
  from flax.serialization import msgpack_restore, from_state_dict
4
 
@@ -16,6 +17,18 @@ print([(k, type(v)) for (k, v) in state.items()])
16
  # logits = state.apply_fn({'params': state.params}, batch['image'])
17
  # print(logits)
18
 
19
- x = st.slider('Select a value')
20
- st.write(x, 'squared is', x * x)
 
 
 
 
 
 
 
 
 
 
 
 
21
 
 
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
 
 
17
  # logits = state.apply_fn({'params': state.params}, batch['image'])
18
  # print(logits)
19
 
20
+ # x = st.slider('Select a value')
21
+ # st.write(x, 'squared is', x * x)
22
+
23
+ # Specify brush parameters and drawing mode
24
+ b_width = st.sidebar.slider("Brush width: ", 1, 100, 10)
25
+ b_color = st.sidebar.beta_color_picker("Enter brush color hex: ")
26
+ bg_color = st.sidebar.beta_color_picker("Enter background color hex: ", "#eee")
27
+ drawing_mode = st.sidebar.checkbox("Drawing mode ?", True)
28
+
29
+ # Create a canvas component
30
+ image_data = st_canvas(
31
+ b_width, b_color, bg_color, height=150, drawing_mode=drawing_mode, key="canvas"
32
+ )
33
+
34