Adapted code, after resampling data

This commit is contained in:
2025-07-31 15:25:11 +02:00
parent f0a17f8a4b
commit 3f87f4627d
10 changed files with 17 additions and 44 deletions
Binary file not shown.
+2 -2
View File
@@ -18,7 +18,7 @@ class Config:
raw_dataset_path="datasets/raw/"
filtered_output_directory="datasets/filtered/"
obfuscated_output_directory="datasets/obfuscated/"
max_images_per_dataset= 10000
max_images_per_dataset= 1500
seg_model_type="models/yolo11l-seg.pt"
pose_model_type="models/yolo11l-pose.pt"
@@ -33,7 +33,7 @@ class Config:
"obfuscation": True, # optional if already done
"post_extract": True, # optional if already done
"analysis": True, # optional if already done
"visualize": False #Should be always true, since it is the last step for reasoning
"visualize": True #Should be always true, since it is the last step for reasoning
}
-29
View File
@@ -103,38 +103,9 @@ def main():
percent_axis=True
)
#TODO: AM WIDER FACE DATENSATZ PRÜFEN, WARUM DIE SCORES SO KOMISCH SIND UND NICHT 100%
#DIE DATEN SIND JA VORBEREITET MIT NO_OP, usw. alles prüfen
#TODO Nur WIDER und CELEBA/UTK; wegen objektverteilung
#TODO: Man NO_OP; Prüfen, wegen objekt matching und klassen
#TODO: HEATMAPS zeichnen; CELEBA, WIDER; verteilung Blau auf schwarz?
#TODO GAnonymization mit "normaler" kopie?
#TODO In paper beispiele zeigen mit den modellen
#TODO: Experimente für kleine modelle wiederholen? Also statt yolov11l zb yolov11n verwenden?
#Möglicherweise gibt es weniger probleme mit besserem modell
#TODO: Die Berechnung jeder einzelnen Metrik überprüfen, metriken prüfen?
#TODO: Die Validitätsprüfung der Daten überprüfen
#TODO: WIE WERDEN DIE METRIKEN BERECHNET?
#TODO: Statt Mittelwert -> Boxplot, bzw Range pro Metrik
#TODO: EINE VISUALISIERUNG MIT NEM OVERALL SCORE, Durchschnitt aller scores?
#TODO Und dann zahlen aufschreibern
#TODO: GGF. Ringmasken verwenden?
#TODO: Verteilung von Gesichtern und Objekten Visualisieren mit Heatmap, pro datenset?
#TODO: "Make unknown faces happy"
# Inputgesicht so optimieren dass emotion besser wird und verschleierung, N-iterationen, Techniken, Parameter anpassen, ...
# !!Idee iterativer generic issue solver? Ein kernel der Bildbasiert-die nutzbarkeit optimiert!!@BA?
@@ -58,7 +58,6 @@ class ObfuscationEngine:
def obfuscate_datasets(self, path_to_filtered_datasets, output_path, verbose=False):
sub_dataset_folders = [os.path.join(path_to_filtered_datasets, sub_dataset_folder) for sub_dataset_folder in os.listdir(path_to_filtered_datasets)]
iterable = sub_dataset_folders
if verbose:
iterable = tqdm(sub_dataset_folders, desc="Obfuscating folders")
+5 -4
View File
@@ -13,10 +13,11 @@ class Style(ObfuscationTechnique):
Replace face with generated face
"""
def __init__(self):
print("Style not activated")
# self.image_processing_path = "C:/Users/bijan/Desktop/obfuscation_platform/project/models/vtoonify/image_cache/"
# resp = requests.get("http://127.0.0.1:8002/init", timeout=180)
# resp.raise_for_status()
# print("Style not activated")
print("Style activated")
self.image_processing_path = "C:/Users/bijan/Desktop/obfuscation_platform/project/models/vtoonify/image_cache/"
resp = requests.get("http://127.0.0.1:8002/init", timeout=180)
resp.raise_for_status()
def obfuscate(self, face_roi_img_bgr: np.ndarray) -> np.ndarray:
+5 -4
View File
@@ -12,10 +12,11 @@ class Swap(ObfuscationTechnique):
Replace face with generated face
"""
def __init__(self):
print("epic not active")
# self.image_processing_path = "C:/Users/bijan/Desktop/obfuscation_platform/project/models/epic/image_cache/"
# resp = requests.get(f"http://127.0.0.1:8000/init", timeout=60)
# resp.raise_for_status()
# print("epic not active")
print("epic active")
self.image_processing_path = "C:/Users/bijan/Desktop/obfuscation_platform/project/models/epic/image_cache/"
resp = requests.get(f"http://127.0.0.1:8000/init", timeout=60)
resp.raise_for_status()
def obfuscate(self, face_roi_img_bgr: np.ndarray) -> np.ndarray:
+5 -4
View File
@@ -13,10 +13,11 @@ class Synthetic(ObfuscationTechnique):
"""
def __init__(self):
print("synthetic not active")
# self.image_processing_path = "C:/Users/bijan/Desktop/obfuscation_platform/project/models/ganonymization/image_cache/"
# resp = requests.get(f"http://127.0.0.1:8003/init", timeout=120)
# resp.raise_for_status()
# print("synthetic not active")
print("synthetic active")
self.image_processing_path = "C:/Users/bijan/Desktop/obfuscation_platform/project/models/ganonymization/image_cache/"
resp = requests.get(f"http://127.0.0.1:8003/init", timeout=120)
resp.raise_for_status()
def obfuscate(self, face_roi_img_bgr: np.ndarray) -> np.ndarray:
Binary file not shown.
Binary file not shown.
Binary file not shown.