Spaces:
Runtime error
Runtime error
class HairstyleRecommendation: | |
def __init__(self): | |
self.hairstyle_recommendations = { | |
'male': { | |
'Oval': ['Pompadour', 'Quiff', 'Classic Tapered Cut'], | |
'Diamond': ['Side Swept Bangs', 'Messy Textured Top', 'Classic Tapered Cut'], | |
'Square': ['Side-Parted Undercut', 'Textured Crop', 'Medium-Length Waves'], | |
'Triangle': ['Textured Fringe', 'Classic Side Part', 'Medium-Length Textured'], | |
'Oblong': ['Classic Short Back', 'Long Comb Over', 'Messy Textured Fringe'], | |
'Round': ['Textured Quiff', 'Undercut with Textured Comb Over', 'Slicked Back'] | |
}, | |
'female': { | |
'Oval': ['Long Layers with Side-Swept Bangs', 'Soft Waves', 'Bob Hair Cut'], | |
'Diamond': ['Layered Pixie Cut', 'Asymmetrical Long Hair', 'Layered Shag Cut'], | |
'Square': ['Shoulder-Length Bob', 'Textured Pixie Cut', 'Layered Shaggy Cut'], | |
'Triangle': ['Long Layers with Volume on Top', 'Medium-Length Waves', 'Pixie Cut with Soft Fringe'], | |
'Oblong': ['Layered Pixie Cut', 'Long Bob', 'Side-Swept Bangs'], | |
'Round': ['High Ponytail', 'Asymmetrical Bob', 'Curtain Bangs'] | |
}} | |
self.hairstyle_images = { | |
'male': { | |
'Oval': ['pompadour.jpg', 'quiff.jpg', 'classic_tapered_cut.jpg'], | |
'Diamond': ['side_swept_bangs.jpg', 'messy_textured_top.jpg', 'classic_tapered_cut.jpg'], | |
'Square': ['side_parted_undercut.jpg', 'textured_crop.jpg', 'medium_length_waves.jpg'], | |
'Triangle': ['textured_fringe.jpg', 'classic_side_part.jpg', 'medium_length_textured.jpg'], | |
'Oblong': ['classic_short_back.jpg', 'long_comb_over.jpg', 'messy_textured_fringe.jpg'], | |
'Round': ['textured_quiff.jpg', 'undercut_with_textured_comb_over.jpg', 'slicked_back.jpg'] | |
}, | |
'female': { | |
'Oval': ['long_layers_with_swept_bangs.jpg', 'soft_waves.jpg', 'bob_hair_cut.jpg'], | |
'Diamond': ['layered_pixie_cut.jpg', 'asymmetrical_long_hair.jpg', 'layered_shag_cut.jpg'], | |
'Square': ['should_length_bob.jpg', 'textured_pixie_cut.jpg', 'layered_shaggy_cut.jpg'], | |
'Triangle': ['long_layers_with_volume_on_top.jpg', 'medium_length_wave.jpg', 'pixie_cut_with_soft_fringe.jpg'], | |
'Oblong': ['long_layers_with_swept_bangs.jpg', 'soft_waves.jpg', 'bob_hair_cut.jpg'], | |
'Round': ['long_layers_with_swept_bangs.jpg', 'soft_waves.jpg', 'bob_hair_cut.jpg'] | |
}} | |
def get_recommendation(self, gender, face_shape): | |
recommended_styles = self.hairstyle_recommendations[gender][face_shape] | |
style_images = self.hairstyle_images[gender][face_shape] | |
return recommended_styles, style_images |