Start the Flask inference server and use its API endpoints to classify videos.
The Flask app (app.py) exposes a browser UI and two API endpoints for listing and classifying test-set videos. It dynamically imports test_already_extracted.py at startup to reuse SingleVideoFeatureLoader and SingleVideoClassifier.
The server binds to http://0.0.0.0:5000 with debug mode enabled:
Index HTML path: /path/to/Flask Local New/index.htmlUser script path: /path/to/Flask Local New/test_already_extracted.pyFeatures dir: /path/to/Flask Local New/features_enhancedModels dir: /path/to/Flask Local New/models_enhancedProcessed test dir: /path/to/Flask Local New/data/processed/test
If test_already_extracted.py is not found next to app.py or in /mnt/data/, the server raises a RuntimeError and will not start.
All paths are configured at the top of app.py. The server first looks for directories relative to app.py (BASE_DIR), then falls back to /mnt/data/ (Linux), then D:\ (Windows).
For each directory, if the local path does not exist, the app checks two alternative locations:
if not FEATURES_DIR.exists(): alt = Path("/mnt/data/features_enhanced") alt2 = Path("D:/features_enhanced") if alt.exists(): FEATURES_DIR = alt elif alt2.exists(): FEATURES_DIR = alt2
The same pattern applies to MODELS_DIR and PROCESSED_TEST_DIR. This makes the app portable across local development machines and remote Linux servers.
Checkpoints are loaded from MODELS_DIR. If a listed checkpoint is missing, the app logs a warning and skips it. If none are found, it falls back to any .pt file in MODELS_DIR. If that also fails, it raises a RuntimeError.
Serves index.html — the browser-based classification UI.Response:text/html — the contents of index.html.Error: Returns HTTP 500 with a plain-text message if index.html is not found.
Whether to apply Test-Time Augmentation. Pass "true" to enable TTA (4 augmentation modes: original, reversed, sped-up, slowed-down). Pass "false" or omit for standard ensemble inference.