Views
No views yet
agesynth/age_vector.py from our original code base at https://gitlab.idiap.ch/biometric/code.ijcb2025.agesynthage_fit_linear_pos.pkl : for linear fittings in the 'aging' direction.age_fit_linear_neg.pkl : for linear fittings in de 'de-aging' direction.age_fit_5_dict.pkl : for polynomial fittings in the 'aging' and 'de-aging' direction.dict with keys corresponding to age brackets of the original subject's age, with lower bound inclusive and upper bound exclusive. The available keys are: ['below-8', '8-to-13', '13-to-18', 18-to-25', '25-to-35', '35-to-45','45-to-55', '55-to-65', 'above-65']1import pickle
2import numpy as np
3
4# Load 5th-order polynomial model for the 25-35 age bracket
5#original_subject_age = 30
6
7with open("age_fit_5_dict.pkl", "rb") as f:
8 model_dict = pickle.load(f)
9coeffs = model_dict["25-to-35"] # numpy array of length 6 (highest order first)
10
11#
12scalar_origin = 0.0 #corresponds to 30 years old in the 25-to-35 age group
13
14# Predict chronological age in years
15age_pred = np.polyval(coeffs, scalar_origin)
16print(f"Predicted age: {age_pred:.1f} years")| File | Model type | Intended direction | Brief description |
|---|---|---|---|
age_fit_linear_pos.pkl | Ordinary Least Squares – linear | Ageing (+) | Linear mapping for positive age deltas |
age_fit_linear_neg.pkl | Ordinary Least Squares – linear | De-ageing (–) | Linear mapping for traversing the age direction in the negative direction |
age_fit_5_dict.pkl | 5-th order polynomial | Both | Captures non-linear relationship between latent scalar and real age |
25-to-35).pickle for loading.1@InProceedings{luevano2024agesynth,
2 title={Identity-Preserving Aging and De-Aging of Faces in the StyleGAN Latent Space},
3 author={Luevano, Luis S. and Korshunov, Pavel and Marcel, Sébastien},
4 booktitle={2025 IEEE International Joint Conference on Biometrics (IJCB)},
5 year={2025}
6}The UTKFace dataset is available for non-commercial research purposes only.
Copyright for the original images belongs to the respective owners.