Metadata-Version: 2.1
Name: streamlit-image-annotation
Version: 0.3.0
Summary: streamlit components for image annotation
Home-page: https://github.com/hirune924/Streamlit-Image-Annotation
Author: hirune924
License: UNKNOWN
Keywords: Python,Streamlit,React,JavaScript
Platform: UNKNOWN
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: streamlit (>=0.63)

# Streamlit Image Annotation

Streamlit component for image annotation.

[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://hirune924-streamlit-image-annotation-exampledetection-gx2ri5.streamlit.app/)
[![PyPI](https://img.shields.io/pypi/v/streamlit-image-annotation)](https://pypi.org/project/streamlit-image-annotation/)
![](./image/demo.gif)
# Features
* You can easily launch an image annotation tool using streamlit.
* By customizing the pre- and post-processing, you can achieve your preferred annotation workflow.
* Currently supports classification and detection tasks.
* Simple UI that is easy to navigate.

# Install
```sh
pip install streamlit-image-annotation
```
# Example Usage
If you want to see other use cases, please check inside the examples folder.
```python
from glob import glob
import pandas as pd
import streamlit as st
from streamlit_image_annotation import classification

label_list = ['deer', 'human', 'dog', 'penguin', 'framingo', 'teddy bear']
image_path_list = glob('image/*.jpg')
if 'result_df' not in st.session_state:
    st.session_state['result_df'] = pd.DataFrame.from_dict({'image': image_path_list, 'label': [0]*len(image_path_list)}).copy()

num_page = st.slider('page', 0, len(image_path_list)-1, 0)
label = classification(image_path_list[num_page], 
                        label_list=label_list, 
                        default_label_index=int(st.session_state['result_df'].loc[num_page, 'label']))

if label is not None and label['label'] != st.session_state['result_df'].loc[num_page, 'label']:
    st.session_state['result_df'].loc[num_page, 'label'] = label_list.index(label['label'])
st.table(st.session_state['result_df'])
```
# Future Work
* Refactoring of the source code.
* Addition of docs about API.
* Addition of example code.
* Addition of segmentation and point tasks.



