Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaciohrdz committed Mar 5, 2023
0 parents commit 7979af2
Show file tree
Hide file tree
Showing 5 changed files with 437 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
runs/
weights/
__pycache__/
16 changes: 16 additions & 0 deletions Readme.md
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/).
15 changes: 15 additions & 0 deletions detect.py
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)

Loading

0 comments on commit 7979af2

Please sign in to comment.