CoolFace
Apppublic

MustafaNoor/AirTrafficControl

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
config.py35 linesDownload Raw Back to root
1import os2 3BASE_DIR = os.path.dirname(os.path.abspath(__file__))4# Project root is two levels up from backend/ (atc-project/ -> project root)5PROJECT_ROOT = os.path.abspath(os.path.join(BASE_DIR, '..', '..'))6 7 8class Config:9    DEBUG = True10    PORT = 786011 12    # --- Models ---13    # Pretrained COCO model used for BOTH detection and segmentation.14    DETECTION_MODEL = os.path.join(BASE_DIR, 'yolov8m-seg.pt')15    # Your trained aircraft-type classifier (8 classes).16    CLASSIFICATION_CHECKPOINT = os.path.join(BASE_DIR, 'outputs', 'resnet50_best.pth')17 18    # Folder that holds metrics + plots produced during training/evaluation.19    OUTPUTS_DIR = os.path.join(BASE_DIR, 'outputs')20 21    # --- Inference params ---22    DETECTION_CONFIDENCE = 0.35       # YOLO box confidence threshold23    SEGMENTATION_CONFIDENCE = 0.3524    MAX_IMAGE_SIZE = 1600             # downscale huge uploads before inference25 26    # COCO class id for "airplane". Detection focuses on aircraft on the runway.27    COCO_AIRPLANE_CLASS = 428    # If True, only airplane detections are kept; other COCO objects are ignored.29    DETECT_AIRPLANES_ONLY = True30 31    # Minimum crop size (px) before a detection is worth classifying.32    MIN_CROP_SIZE = 1633 34    CORS_ORIGINS = ['*']35