File size: 2,072 Bytes
49b750e
 
 
 
 
 
 
ca915d8
49b750e
 
c50fbca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1f12c3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
library_name: keras
tags:
  - tensorflow
  - keras
  - face-shape-classification
  - cnn
pipeline_tag: image-classification
license: apache-2.0
---



# FaceShape Model

## Model Description
This model classifies facial shapes into categories such as oval, square, round, etc. It is designed for applications in virtual try-ons and eyeglass frame recommendations.

- **Framework:** TensorFlow (Keras)
- **Model Format:** `.h5`
- **Purpose:** Face shape classification.

## How to Use
To use this model, you can load it with TensorFlow and Keras. Below is an example:

```python
from tensorflow.keras.models import load_model

# Load the model
model = load_model("path_to_your_model.h5")

# Example input
input_data = ...  # Replace with your preprocessed input
output = model.predict(input_data)
print(output)



## Training Details
The model was trained using a Convolutional Neural Network (CNN) architecture on the [Face Shape Classification Dataset](https://www.kaggle.com/datasets/lucifierx/face-shape-classification).

### Preprocessing Steps
- **Image Size**: All input images were resized to 224x224 pixels.
- **Normalization**: Pixel values were normalized to the range [0, 1].
- **Data Augmentation**: Techniques like rotation, flipping, and zooming were applied to improve generalization.

### Training Configuration
- **Framework**: TensorFlow (Keras)
- **Optimizer**: Adam
- **Loss Function**: Categorical Crossentropy
- **Batch Size**: 32
- **Epochs**: 50
- **Validation Accuracy**: Achieved 85% on the validation set.

### Hardware
The model was trained on an NVIDIA GPU for faster computation.

## Limitations
- The model may not perform well with low-resolution or occluded images.
- The dataset may not represent all possible face shapes, which could limit generalization.

## Example Predictions
Here are some example predictions:

| Input Image       | Predicted Class |
|--------------------|-----------------|
| ![example1](https://via.placeholder.com/100) | Oval             |
| ![example2](https://via.placeholder.com/100) | Square           |