Spaces:
Sleeping
Sleeping
metadata
title: SENTINEL_AI
emoji: 🤖
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
short_description: FastAPI AI image detector with batch scan support
SENTINEL_AI
SENTINEL_AI is a FastAPI-powered AI image detector with a dark cyberpunk HTML frontend.
The app supports:
- single-image prediction
- batch prediction
Default ScanAI-Sensitive
Hugging Face Spaces deployment
This repository is prepared for a Hugging Face Docker Space.
Included deployment files:
Dockerfile.dockerignore- this
README.mdwith Space metadata requirements.txtfor a lighter inference-only buildrequirements-full.txtif you want the older training and Streamlit tooling locally
Hugging Face will build the Docker image and run the app on port 7860.
App routes
GET /serves the frontend fromstatic/index.htmlGET /healthreturns a simple health checkPOST /predictaccepts one uploaded imagePOST /predict/batchaccepts multiple uploaded images
The app loads the trained model at startup from:
artifacts/ai_image_detector.keras
Local development
Python
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --host 127.0.0.1 --port 8000
If you want the older training and Streamlit dependencies too:
pip install -r requirements-full.txt
Docker
docker build -t sentinel-ai .
docker run --rm -p 7860:7860 sentinel-ai
Then open:
http://127.0.0.1:7860
Project structure
main.py: FastAPI entrypointstatic/index.html: frontend UIsrc/ai_image_detector/: shared inference codeartifacts/: trained model and related artifactspredict.py: terminal prediction helpertrain.py: model training script
Notes
- The app requires a trained model artifact before deployment.
data/is not needed for inference-only deployment, so it is excluded from the Docker build context.- If you retrain the model, make sure the updated
artifacts/ai_image_detector.kerasis included before pushing to the Space. - The model file
artifacts/ai_image_detector.kerasis not excluded by.dockerignore, so it will be copied into the Docker image.
Publish to Hugging Face Spaces
- Create a new Hugging Face Space.
- Choose
Dockeras the SDK. - Push this repository to the Space repository.
- Wait for the Docker build to finish.
- Open the Space URL once the build is green.
Example git flow:
git init
git lfs install
git add .gitattributes
git add .
git commit -m "Prepare Hugging Face Docker Space"
git branch -M main
git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME
git push -u origin main
If you already have a Space repository, you can also clone that repo first and copy this project into it before committing and pushing.
After deploy, these routes should be available:
//health/predict/predict/batch