This is an ML model to segment hairs in pictures.
The code used to publish to Replicate
is in the replicate
directory.
The Neural network, that is used to crop the part of image that has hair, is a fine-tuned model based on Yolo8x-seg.
In the post process, it uses k-means clustering, followed by BFS on similar pixels, to separate hair pixels.
You can play around with the implementation in the Google Colab.
Notice, its .ipynb
file is also saved in this repository if you prefer local Jupyter lab instance.