From a010c4188ffd7b6f05be53e98b1c02bfe7f15848 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Fri, 24 Feb 2023 11:37:57 +0000 Subject: [PATCH] deprecated functions --- deepface/DeepFace.py | 4 ++-- deepface/commons/functions.py | 3 ++- requirements.txt | 3 ++- setup.py | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/deepface/DeepFace.py b/deepface/DeepFace.py index d4400e0..33064d3 100644 --- a/deepface/DeepFace.py +++ b/deepface/DeepFace.py @@ -12,6 +12,7 @@ import pandas as pd from tqdm import tqdm import cv2 import tensorflow as tf +from deprecated import deprecated # package dependencies from deepface.basemodels import ( @@ -812,11 +813,10 @@ def extract_faces( # deprecated functions +@deprecated(version="0.0.78", reason="Use DeepFace.extract_faces instead of DeepFace.detectFace") def detectFace( img_path, target_size=(224, 224), detector_backend="opencv", enforce_detection=True, align=True ): - print("⚠️ Function detectFace is deprecated! Use extract_faces instead of this.") - face_objs = extract_faces( img_path=img_path, target_size=target_size, diff --git a/deepface/commons/functions.py b/deepface/commons/functions.py index b9ee0de..0569fba 100644 --- a/deepface/commons/functions.py +++ b/deepface/commons/functions.py @@ -8,6 +8,7 @@ import requests import numpy as np import cv2 import tensorflow as tf +from deprecated import deprecated # package dependencies from deepface.detectors import FaceDetector @@ -257,6 +258,7 @@ def find_target_size(model_name): # deprecated functions +@deprecated(version="0.0.78", reason="Use extract_faces instead of preprocess_face") def preprocess_face( img, target_size=(224, 224), @@ -265,7 +267,6 @@ def preprocess_face( enforce_detection=True, align=True, ): - print("⚠️ Function preprocess_face function is deprecated! Use extract_faces instead of this.") result = None img_objs = extract_faces( img=img, diff --git a/requirements.txt b/requirements.txt index 0e8a0ed..40b7903 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,5 @@ dlib>=19.20.0 retina-face>=0.0.1 mediapipe>=0.8.7.3 fire>=0.4.0 -gunicorn>=20.1.0 \ No newline at end of file +gunicorn>=20.1.0 +Deprecated>=1.2.13 \ No newline at end of file diff --git a/setup.py b/setup.py index 7b192f0..593880d 100644 --- a/setup.py +++ b/setup.py @@ -36,5 +36,6 @@ setuptools.setup( "retina-face>=0.0.1", "fire>=0.4.0", "gunicorn>=20.1.0", + "Deprecated>=1.2.13", ], )