An app that helps you paint from pictures by bringing them down to basic lines, shapes and colors.
-
Make sure you have
uv
installed -
Install dependencies in virtual environment:
uv sync
-
Download the model with:
wget -q https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -P model
-
Run the app, upload pictures and have fun! 🖼️
uv run streamlit run src/painting_tutor/app/app.py
Tip: clean up the cache
folder every once in a while to save disk space.
The algorithm takes averages over colors of segments in the images. These are often not the same colors as one would normally paint! This is because averages over many colors tend to become gray. Increasing the number of colors per segment or mask will get you closer to the true colors.
Other models available:
wget -q https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth -P model
wget -q https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth -P model
wget -q https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -P model