Interactive annotation using Streamlit

I don’t think this is possible with streamlit as it currently is, though the current planned for features on their roadmap will make it possible. Specifically the work they are doing on supporting the idea of a state:

Right now, getting a Streamlit app to store internal state, like information a user entered in a form, is simply too tricky. There are some workarounds for session state , but we want to give you a baked-in and elegant version of programmable state so you can build apps with sequential logic, apps with multiple pages, apps that incrementally ask users for input, and so on.

The exisiting ways to do this are a bit hard, I tried a couple, but decided to wait for the official session state thingamajig.

Currently streamlit is setup as a single use application, i.e anytime u do anything, everything re-runs from the top. For simple interfaces this works well, but for anything which needs to remember stuff - it doesn’t, unless you write your own logic which saves stuff to disk in b/w runs.

That all said, I don’t think its worthwhile trying to accomplish image tagging using streamlit. There are a number of existing options, prodigy by spacy in particular looks really easy to use. There are a bunch of open source options as well, this one looks easy to use and is free.

I’d consider seperating out the image annotation work - label images seperately, then use streamlit for the frontend which reads in the images, their labels, and does some stuff with that info.