I am new to streamlit. I was trying to setup a simple annotation process for a pet project. So, I have all the filenames stored in a pandas dataframe. Now, the annotation process is supposed to have this flow:
- Iterate over the files
- Read an image. Display it
- Annotate using radio boxes.
- Increment the loop counter only when the user clicks “Next”
Here is a sample similar to what I have been trying but that didn’t work out:
def annotate_data(df): file_wid = st.empty() img_wid = st.empty() labels = ("cat", "dog") go_next = st.button("Next") for i in range(len(df)): fname = df["fname"][i] name = str(fname) # Display the name of the file value = file_wid.text(name) st.write(value) time.sleep(1) # Display the image # Add label using radio box # Wait untl user press next st.write("Done")
It would be really helpful if someone can provide some pointers