300030 Timisoara, Romania, Piata Victoriei nr.3, tel: +40.256-490.771, e-mail: office@cciat.ro
300575 Timisoara, Romania, Bv.Eroilor de la Tisa nr.22, tel: +40.256.490.772, e-mail: office@cciat.ro
@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"
def __init__(self, analyzer: MaleModelHeightAnalyzer): self.analyzer = analyzer self.heights = analyzer.heights height of male models
@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}\"" @staticmethod def ft_in_to_cm(ft: int
@app.post("/analyze/upload-models") async def upload_models(models: List[ModelInput]): """Upload multiple male models for analysis""" model_objects = [MaleModel( id=f"M{idx:04d}", name=m.name, height_cm=m.height_cm, agency=m.agency, category=m.category ) for idx, m in enumerate(models)] inches: float) ->
def height_outliers(self, multiplier: float = 1.5) -> List[Dict]: """Detect height outliers using IQR method""" if len(self.heights) < 4: return [] q1 = statistics.quantiles(self.heights, n=4)[0] q3 = statistics.quantiles(self.heights, n=4)[2] iqr = q3 - q1 lower_bound = q1 - multiplier * iqr upper_bound = q3 + multiplier * iqr outliers = [] for model in self.models: if model.height_cm < lower_bound or model.height_cm > upper_bound: outliers.append({ "id": model.id, "name": model.name, "height_cm": model.height_cm, "height_ft_in": model.height_ft_in, "deviation": "below" if model.height_cm < lower_bound else "above" }) return outliers
analyzer = MaleModelHeightAnalyzer(model_objects) return { "message": f"Successfully uploaded {len(model_objects)} models", "basic_stats": analyzer.basic_statistics(), "category_fit": analyzer.category_fit() } @app.get("/analyze/height-stats", response_model=HeightStatsResponse) async def get_height_statistics(min_height: Optional[float] = None, max_height: Optional[float] = None): """Get aggregated height statistics""" # Implementation would query database pass