""" setup_dirs.py — MFAF-Net Directory Setup Script Run once before starting the application to ensure all required directories exist. Usage: python setup_dirs.py """ import os ROOT = os.path.dirname(os.path.abspath(__file__)) REQUIRED_DIRS = [ os.path.join(ROOT, 'static', 'results'), os.path.join(ROOT, 'static', 'uploads'), os.path.join(ROOT, 'static', 'css'), os.path.join(ROOT, 'static', 'js'), os.path.join(ROOT, 'templates'), os.path.join(ROOT, 'mfaf_net'), # Dataset directory — extract Complete_PlasticSurgery_Datasets.zip here os.path.join(ROOT, 'data'), ] def setup(): print("MFAF-Net — Directory Setup") print("=" * 40) for d in REQUIRED_DIRS: if os.path.isdir(d): print(f" [exists] {d}") else: os.makedirs(d, exist_ok=True) print(f" [created] {d}") print("=" * 40) print("Setup complete. All required directories are ready.") if __name__ == '__main__': setup()