Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ if not os.path.exists('models/age_model.pth') and not os.path.exists('models/gen
|
|
| 25 |
gdown.download(url = "https://drive.google.com/uc?export=download&id=1--9er5O6Hpe5Ete95lT50BPABTqzrWi2", output = 'models/race_model.pth')
|
| 26 |
gdown.download(url = "https://drive.google.com/uc?export=download&id=1-8QdoEfxC6GIxfBM7P_Scx_vuv8XI5V_", output = 'models/joint_model.pth')
|
| 27 |
|
| 28 |
-
DEMO_IMAGE = 'demo.
|
| 29 |
GENDER_DICT = {
|
| 30 |
1: 'Female',
|
| 31 |
0: 'Male'
|
|
@@ -122,7 +122,7 @@ The app is available and can be accessed via two platforms
|
|
| 122 |
|
| 123 |
- Data processing: The dataset exhibited a pronounced class imbalance in the age category, with a dominance of images of infants (0 - 4 years) as compared to other age ranges. This imbalance can adversely affect the performance of regression models that rely on accurate representation of all age groups. To address this issue, I employed a strategic approach that randomly discards 30% of examples containing images of individuals aged < 4.
|
| 124 |
|
| 125 |
-
- Model selection and training details: For the standalone models,
|
| 126 |
After experimentation, I discovered the weighting scheme that performed well as follows:
|
| 127 |
* 0.001 * age loss
|
| 128 |
* gender loss
|
|
|
|
| 25 |
gdown.download(url = "https://drive.google.com/uc?export=download&id=1--9er5O6Hpe5Ete95lT50BPABTqzrWi2", output = 'models/race_model.pth')
|
| 26 |
gdown.download(url = "https://drive.google.com/uc?export=download&id=1-8QdoEfxC6GIxfBM7P_Scx_vuv8XI5V_", output = 'models/joint_model.pth')
|
| 27 |
|
| 28 |
+
DEMO_IMAGE = 'demo.jpg'
|
| 29 |
GENDER_DICT = {
|
| 30 |
1: 'Female',
|
| 31 |
0: 'Male'
|
|
|
|
| 122 |
|
| 123 |
- Data processing: The dataset exhibited a pronounced class imbalance in the age category, with a dominance of images of infants (0 - 4 years) as compared to other age ranges. This imbalance can adversely affect the performance of regression models that rely on accurate representation of all age groups. To address this issue, I employed a strategic approach that randomly discards 30% of examples containing images of individuals aged < 4.
|
| 124 |
|
| 125 |
+
- Model selection and training details: For the standalone models, efficientnet_b0 was employed as the backbone architecture, with task-specific heads appended for each of the sub-tasks i.e. binary classification for gender prediction, regression for age prediction and multi-class classification for race prediction. The models were trained with separate pytorch lightning trainer modules for 25 epochs each. <br> As for the joint model, a single pytorch lightning trainer was used to train and optimize all three objectives.
|
| 126 |
After experimentation, I discovered the weighting scheme that performed well as follows:
|
| 127 |
* 0.001 * age loss
|
| 128 |
* gender loss
|