Height Of Male Models Direct

def plot_height_by_agency(self, agency_colors: Dict[str, str] = None): """Plot height distribution grouped by agency""" agency_groups = {} for model in self.analyzer.models: if model.agency: if model.agency not in agency_groups: agency_groups[model.agency] = [] agency_groups[model.agency].append(model.height_cm) if not agency_groups: print("No agency data available") return fig, ax = plt.subplots(figsize=(12, 6)) positions = range(len(agency_groups)) bp = ax.boxplot(agency_groups.values(), positions=positions, widths=0.6, patch_artist=True, showmeans=True) # Color boxes if agency_colors: for i, box in enumerate(bp['boxes']): agency = list(agency_groups.keys())[i] box.set_facecolor(agency_colors.get(agency, 'lightblue')) ax.set_xticklabels(agency_groups.keys(), rotation=45, ha='right') ax.set_ylabel('Height (cm)') ax.set_title('Height Distribution by Modeling Agency') ax.grid(True, alpha=0.3, axis='y') plt.tight_layout() plt.show() from fastapi import FastAPI, HTTPException, Query from typing import List, Optional from pydantic import BaseModel app = FastAPI(title="Male Model Height Analysis API")

def percentile_distribution(self) -> Dict: """Get height percentiles""" if not self.heights: return {} percentiles = [10, 25, 50, 75, 90, 95, 99] return { f"p{p}": round(statistics.quantiles(self.heights, n=100, method='exclusive')[p-1], 1) for p in percentiles if p-1 < len(statistics.quantiles(self.heights, n=100, method='exclusive')) }

@staticmethod def cm_to_ft_in(cm: float) -> str: total_inches = cm / 2.54 feet = int(total_inches // 12) inches = round(total_inches % 12, 1) return f"{feet}'{inches}\"" height of male models

from dataclasses import dataclass from datetime import datetime from typing import List, Optional, Dict import statistics @dataclass class MaleModel: id: str name: str height_cm: float # height in centimeters height_ft_in: Optional[str] = None # e.g., "6'1"" agency: Optional[str] = None category: Optional[str] = None # runway, commercial, fitness, etc. measurement_date: Optional[datetime] = None

def __init__(self, models: List[MaleModel]): self.models = models self.heights = [m.height_cm for m in models] ax = plt.subplots(figsize=(12

def __post_init__(self): if not self.height_ft_in and self.height_cm: self.height_ft_in = self.cm_to_ft_in(self.height_cm)

@staticmethod def ft_in_to_cm(ft: int, inches: float) -> float: return (ft * 12 + inches) * 2.54 class MaleModelHeightAnalyzer: """Feature for analyzing male model heights""" # Industry standard height ranges (cm) RUNWAY_MIN = 185 # 6'1" RUNWAY_MAX = 192 # 6'3.6" COMMERCIAL_MIN = 175 # 5'9" COMMERCIAL_MAX = 190 # 6'2.8" FITNESS_MIN = 178 # 5'10" FITNESS_MAX = 188 # 6'2" Query from typing import List

def __init__(self, analyzer: MaleModelHeightAnalyzer): self.analyzer = analyzer self.heights = analyzer.heights