From bcb26536109e106f8a95c6b7a463f34a4164a79f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Hern=C3=A1ndez=20Montilla?= Date: Sun, 12 Mar 2023 22:23:52 +0100 Subject: [PATCH] Minor updates (and more Pexels images) --- Readme.md | 2 +- prepare_data.py | 10 +++++++--- requirements.txt | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index b9480f4..2f41345 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -# Face parts detection with YOLOv8 👃 +# Face parts detection with YOLOv8 🎯 ## Introduction diff --git a/prepare_data.py b/prepare_data.py index 88f96cb..aa13765 100644 --- a/prepare_data.py +++ b/prepare_data.py @@ -9,6 +9,7 @@ from utils import * import shutil import glob +from unidecode import unidecode import pandas as pd import os @@ -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 diff --git a/requirements.txt b/requirements.txt index 36d30d4..c918d8d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 @@ -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