Animated (GIF) masks after each epoch.
Only semantic segmentation is supported.
First you need to install gifsicle:
$ sudo apt-get install gifsicle
Then install animask by pip or directly from repo:
$ pip install animask
or
$ pip install git+https://github.com/sankovalev/animask.git
from animask import Animask
# init object with the image that the mask will be predicted for
animated = Animask(image)
# === repeat this every epoch: ===
# train your model ...
# predict mask for image
# and then add to object as numpy array
animated.add(predicted_mask)
# === finish training ===
# save your gif
animated.save("path_to_file_here.gif")
By default, masks will be saved without a background. To apply masks over the original image, save it with flag:
animated.save("path_to_file_here.gif", with_background=True)
Additionally, you can configure mask titles, color or transparency and etc.
MIT