Skip to content

Commit

Permalink
Minor updates (and more Pexels images)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaciohrdz committed Mar 12, 2023
1 parent 8495a3f commit bcb2653
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Face parts detection with YOLOv8 👃
# Face parts detection with YOLOv8 🎯

## Introduction

Expand Down
10 changes: 7 additions & 3 deletions prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from utils import *
import shutil
import glob
from unidecode import unidecode

import pandas as pd
import os
Expand Down Expand Up @@ -159,16 +160,19 @@ def process_names(names, split, path_data, path_dest, skip):
path_pexels_annotations = os.path.join(path_pexels_dataset, s, "annotations", "obj_train_data")
path_pexels_images = os.path.join(path_pexels_dataset, s, "images")
pexels_labels = os.listdir(path_pexels_annotations)
pexels_names.extend([os.path.splitext(l)[0] for l in pexels_labels])

for l in pexels_labels:
# Cleaning the names to avoid files with weird accents and characters
file_name_cleaned = unidecode(os.path.splitext(l)[0])
pexels_names.append(file_name_cleaned)

img_name = os.path.splitext(l)[0] + ".jpg"
img_source = os.path.join(path_pexels_images, img_name)
img_dest = os.path.join(path_processed_images, img_name)
img_dest = os.path.join(path_processed_images, file_name_cleaned + ".jpg")
shutil.copy(img_source, img_dest)

label_source = os.path.join(path_pexels_annotations, l)
label_dest = os.path.join(path_processed_labels, l)
label_dest = os.path.join(path_processed_labels, file_name_cleaned + ".txt")
shutil.copy(label_source, label_dest)

# Separate the Helen dataset in training and validation
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ setuptools==65.6.3
six==1.16.0
smmap==5.0.0
stack-data==0.6.2
supervision~=0.3.0
tensorboard==2.11.2
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
Expand All @@ -66,7 +67,8 @@ torchvision==0.14.1+cu116
tqdm==4.64.1
traitlets==5.8.1
typing_extensions==4.4.0
ultralytics==8.0.9
unidecode~=1.3.6
ultralytics~=8.0.53
urllib3==1.26.14
wcwidth==0.2.6
Werkzeug==2.2.2
Expand Down

0 comments on commit bcb2653

Please sign in to comment.