Tip
📄 Paper with detailed explanation of the structure of the combination of CLIP-DINO-SAM
models: PDF
Github with detailed workflow of labelling data with CLIP-DINO-SAM
for YOLO
: Github
Here are example predictions of YOLO model segmenting parts of face after being trained on an auto-labeled dataset using CLIP-DINO-SAM
CLIP-DINO-SAM
combination is a Huge module that works relatively not quickly as it requires relatively Big ammounts of GPU. So i will show you a detailed workthroug for only two images to save your time on waiting for the results and my time on writing this tutorial. For the most curious ones i will leave a complete pipeline for training on custom face dataset. Enjoy 🎉
git clone https://github.com/Mikzarjr/Face-Segmentation
pip install -r FaceSeg/requirements.txt
or
pip install -e setup.py
from FaceSegmentation.Pipeline.Config import *
from FaceSegmentation.Pipeline.Segmentation import FaceSeg
sample images are located in FaceSeg/TestImages
image_path = f"{IMGS_DIR}/img1.jpeg"
Main segmentation mask is located in /segmentation/combined_masks
All separate masks are located in /segmentation/split_masks
S = FaceSeg(image_path)
S.Segment()
from FaceSegmentation.Pipeline.Annotator import CreateJson
image_path = "/content/segmentation/img1/img1.jpg"
A = CreateJson(image_path)
A.CreateJsonAnnotation()
A.CheckJson()
Output will be in COCO_DIR
named COCO.json
from FaceSegmentation.Pipeline.Converter import COCO-to-YOLO
json_path = f"{COCO_DIR}/COCO.json"
C = ConvertCtY(image_path)
C.Convert()
Output will be in YOLO_DIR
named YOLO.json