This is a Streamlit app heavily based on BirdsPyView for efficiently generating training lables for the narya API.
First make sure you have Python installed.
Then install OpenCV, Streamlit and Streamlit Drawable Canvas:
pip install opencv-python
pip install streamlit
pip install streamlit-drawable-canvas
Finally, clone the repo and inside narya-label-creator run:
streamlit run label_vertical_pitch.py or
streamlit run label_player.py
-
Make sure that homography/raw_images/ contains images you would like to label (dimension 512x512).
-
Open the tool as outline above.
-
Pick the largest area of the pitch you are comfortably seeing (e.g. offensive half, penalty area, ...) in the dropdown menu on the right.
-
Draw four markers by clicking on the canvas (drawing on the border is possible) starting at the top left to then proceed counter-clockwise.
-
After the fourth marker is provided the app will generate the homography estimation and the full keypoints mask.
-
If you are happy with the results click 'Store Results'. The results and the original image will be stored in the homography and keypoints folder. The original image will be removed from raw_images.
-
To get the next image to label, simply refresh the page.
-
Make sure that player_tracking/raw_images/ contains images you would like to label (dimension 1024x1024).
-
Open the tool as outline above.
-
Draw boxes around every player and referee you see on the pitch.
-
When you are happy click 'Accept Data'. The coordinates of the bounding boxes will be aggregatd into a data frame that appears on the right.
-
If you are happy with the data click 'Store Results'. The results and the original image will be stored in the respective folders. The original image will be removed from raw_images.
-
If you encounter an image you don't want to label click 'Delete Image'. The image will be removed from raw_images.
-
To get the next image to label, simply refresh the page.