Skip to content

rzamarefat/face-segmentation-yolo-sam2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Segmentation

A face segmentation tool based on YOLOv8 and SAM2

Demo

output.mp4

How to use

  • Create a Python3 virtual env
python3 -m venv ./venv
  • Activate the environment creatred in the previous step
  • install the requirements in requirements.txt file
pip install -r requirements
  • Code for inferring the pipeline on image and video
import cv2
from FaceSegmentHandler import FaceSegmentHandler

img = cv2.imread(r".\test_data\people.jpg")
fs = FaceSegmentHandler()
segmented_img = fs.segment_on_image(img)
cv2.imwrite("segmented_img.png", segmented_img)
fs.segment_on_video(r".\test_data\people.mp4")

About

A face segmentation tool based on YOLOv8 and SAM2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published