cleaned up for submission

This commit is contained in:
2026-07-10 20:13:13 +02:00
parent 47fbb19761
commit 7eff030e89
38 changed files with 39 additions and 4175 deletions

14
Tune.py
View File

@@ -5,7 +5,6 @@ from sklearn.metrics import classification_report
import copy
# Framework and Utility Imports
import SetUp
import Util
from sets.Data import *
from sets.IdentitySubset import IdentitySubset
@@ -43,6 +42,16 @@ RESOLUTION:int = 224
'''
ARCH = Architecture.RESNET34
def get_device():
if torch.cuda.is_available():
# clear cach to boost memory
# for new round
torch.cuda.empty_cache()
return torch.device("cuda")
else:
return torch.device("cpu")
# Data preparation and model setup
def prepare_data_and_model_environment():
@@ -50,7 +59,8 @@ def prepare_data_and_model_environment():
Handles environment discovery, downloads/loads datasets, generates
train-test class splits, and configures the architecture base.
"""
device = SetUp.get_device()
# get Cuda or CPU.
device = get_device()
dataset_name = Set_Name.CASIAFACES
if dataset_name == Set_Name.CASIAFACES:
SAMPLE_SIZE = 400