forked from ignaciohrdz/yolo-face-parts-detector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7979af2
Showing
5 changed files
with
437 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea | ||
runs/ | ||
weights/ | ||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Face parts detection with YOLOv8 ππππ | ||
|
||
## Introduction | ||
|
||
In this project I will use the most recent implementation of YOLO by Ultralytics, [YOLOv8](https://github.com/ultralytics/ultralytics). The goal is to train an algorithm that is able to detect separate face parts without having to use landmark detectors that don't do well when part of the face is occluded or missing. It is also a great opportunity to try out the `ultralytics` library. | ||
|
||
## Data | ||
|
||
For this experiment I'm using the following sources: | ||
|
||
- Existing datasets: all these datasets were processed by converting each group of facial landmarks (eye, mouth, nose, eyebrows) to a bounding box compatible with YOLO. | ||
- [Helen dataset](http://www.ifp.illinois.edu/~vuongle2/helen/) | ||
- [Menpo2D dataset](https://github.com/jiankangdeng/MenpoBenchmark) | ||
- [AFW (Annotated Faces in the Wild)](https://ibug.doc.ic.ac.uk/resources/facial-point-annotations/) | ||
- Custom datasets: | ||
- [Pexels](https://pexels.com): I downloaded 85 images from this website and annotated them using [CVAT](https://app.cvat.ai/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from ultralytics import YOLO | ||
from pathlib import Path | ||
import os | ||
import cv2 | ||
from prepare_data import smart_resize | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
path_model = os.path.join("runs", "detect", "train", "weights") | ||
|
||
# Creating the model | ||
model = YOLO(os.path.join(path_model, "best.pt")) | ||
results = model.predict(source="0", show=True) | ||
|
Oops, something went wrong.