CoolFace
Apppublic

Droid210/FleetVision

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
body_classifier.py26 linesDownload Raw Back to root
1"""Model A wrapper for fleet tier identification."""2from __future__ import annotations3 4from models.model_a.inference import classify_car_type5 6TIER_MAPPING = {7    "Sedan": "UberX",8    "SUV": "UberXL",9    "VAN": "UberXL",10    "Hatchback": "UberX",11    "Coupe": "UberX",12    "Convertible": "Uber Black",13    "Pick-Up": "UberXL",14}15 16 17def identify_vehicle_tier(front_image_path: str, model_path: str = "weights/model a/best_body_classifier.pth") -> dict:18    """Classify car body type and map it to a dispatch tier."""19    body_type, confidence = classify_car_type(front_image_path, model_path=model_path)20    tier = TIER_MAPPING.get(body_type, "UberX")21    return {22        "body_type": body_type,23        "body_confidence": round(confidence, 4),24        "uber_tier": tier,25    }26