Skip to content

Commit aea8b9a

Browse files
committed
feat: Add UI preview images, update frontend access port, and refactor Docker Compose for model service management.
1 parent 2bc558d commit aea8b9a

File tree

8 files changed

+122
-35
lines changed

8 files changed

+122
-35
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ models/audio/vocoder_artifacts/models/librifake_pretrained_lambda0.5_epoch_25.pt
1212
deepsafe_utils/__pycache__/visualizer.cpython-313.pyc
1313
.gitignore
1414
#ignore all .pyc files
15-
*.pyc
15+
*.pyc
16+
models/audio/vocoder_artifacts/temp_repo

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ install:
1616
start:
1717
@echo "Starting DeepSafe..."
1818
docker-compose up -d
19-
@echo "DeepSafe is running at http://localhost:80"
19+
@echo "DeepSafe is running at http://localhost:8888"
2020

2121
stop:
2222
@echo "Stopping DeepSafe..."

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ DeepSafe adopts a **microservices architecture** where each detection model runs
3232
- **Dockerized Architecture**: Fully containerized services for easy deployment and isolation.
3333
- **RESTful API**: Robust FastAPI backend with health checks, batch processing, and detailed logging.
3434

35+
## 📸 UI Preview
36+
37+
<div align="center">
38+
<img src="docs/images/login_page.png" alt="Login Page" width="45%">
39+
<img src="docs/images/dashboard.png" alt="Dashboard" width="45%">
40+
</div>
41+
3542
## 🏗️ Architecture
3643

3744
DeepSafe orchestrates a fleet of specialized detectors via a central API gateway:
@@ -73,7 +80,7 @@ graph TD
7380
*This will build all containers and start the services. Initial build may take a few minutes.*
7481

7582
3. **Access the Dashboard**:
76-
Open `http://localhost:80` in your browser.
83+
Open `http://localhost:8888` in your browser.
7784

7885
4. **API Documentation**:
7986
Visit `http://localhost:8000/docs` for the interactive Swagger UI.

api/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ RUN pip install uv && \
2323

2424
# Copy application code
2525
COPY main.py .
26+
COPY database.py .
2627

2728
# Expose the port the app runs on
2829
EXPOSE ${PORT}

docker-compose.yml

Lines changed: 103 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ services:
1414
- PORT=8000
1515
- META_MODEL_ARTIFACTS_DIR=/app/meta_model_artifacts
1616
- DEEPSAFE_CONFIG_FILE_PATH=/app/config/deepsafe_config.json
17+
# - LOG_LEVEL=debug # Optional: for more verbose API logs
1718
depends_on:
1819
- npr_deepfakedetection
1920
- universalfakedetect
20-
- cross_efficient_vit
21-
- vocoder_artifacts
21+
# Add other future video/audio model service names here
2222
networks:
2323
- deepsafe-network
2424

@@ -37,6 +37,36 @@ services:
3737
networks:
3838
- deepsafe-network
3939

40+
# yermandy_clip_detection:
41+
# build: ./models/image/yermandy_clip_detection
42+
# container_name: deepsafe-yermandy-clip-detection
43+
# ports:
44+
# - "5002:5002"
45+
# restart: unless-stopped
46+
# environment:
47+
# - MODEL_PORT=5002
48+
# - MODEL_PATH=model_code/weights/model.ckpt
49+
# - PRELOAD_MODEL=false
50+
# - MODEL_TIMEOUT=600
51+
# - USE_GPU=false
52+
# networks:
53+
# - deepsafe-network
54+
55+
# wavelet_clip_detection:
56+
# build: ./models/image/wavelet_clip_detection
57+
# container_name: deepsafe-wavelet-clip-detection
58+
# ports:
59+
# - "5003:5003"
60+
# restart: unless-stopped
61+
# environment:
62+
# - MODEL_PORT=5003
63+
# - MODEL_PATH=model_code/weights/clip_wavelet_best.pth
64+
# - PRELOAD_MODEL=false
65+
# - MODEL_TIMEOUT=600
66+
# - USE_GPU=false
67+
# networks:
68+
# - deepsafe-network
69+
4070
universalfakedetect:
4171
build: ./models/image/universalfakedetect
4272
container_name: deepsafe-universalfakedetect
@@ -51,7 +81,48 @@ services:
5181
networks:
5282
- deepsafe-network
5383

54-
# --- Video Model Services ---
84+
# trufor:
85+
# build: ./models/image/trufor
86+
# container_name: deepsafe-trufor
87+
# ports:
88+
# - "5005:5005"
89+
# restart: unless-stopped
90+
# environment:
91+
# - MODEL_PORT=5005
92+
# - PRELOAD_MODEL=false
93+
# - MODEL_TIMEOUT=600
94+
# - USE_GPU=false
95+
# networks:
96+
# - deepsafe-network
97+
98+
# spsl_deepfake_detection:
99+
# build: ./models/image/spsl_deepfake_detection
100+
# container_name: deepsafe-spsl-deepfake-detection
101+
# ports:
102+
# - "5006:5006"
103+
# restart: unless-stopped
104+
# environment:
105+
# - MODEL_PORT=5006
106+
# - PRELOAD_MODEL=false
107+
# - MODEL_TIMEOUT=600
108+
# - USE_GPU=false
109+
# networks:
110+
# - deepsafe-network
111+
112+
# ucf_deepfake_detection:
113+
# build: ./models/image/ucf_deepfake_detection
114+
# container_name: deepsafe-ucf-deepfake-detection
115+
# ports:
116+
# - "5007:5007"
117+
# restart: unless-stopped
118+
# environment:
119+
# - MODEL_PORT=5007
120+
# - PRELOAD_MODEL=false
121+
# - MODEL_TIMEOUT=600
122+
# - USE_GPU=false
123+
# networks:
124+
# - deepsafe-network
125+
55126
cross_efficient_vit:
56127
build: ./models/video/cross_efficient_vit
57128
container_name: deepsafe-cross-efficient-vit
@@ -60,34 +131,42 @@ services:
60131
restart: unless-stopped
61132
environment:
62133
- MODEL_PORT=7001
63-
- PRELOAD_MODEL=false
64-
- MODEL_TIMEOUT=900
65-
- USE_GPU=false
134+
- PRELOAD_MODEL=false
135+
- MODEL_TIMEOUT=900 # Video models might be heavier, allow longer idle time
136+
- USE_GPU=false # Ensure CPU operation
137+
# The following are set within the cross_efficient_vit/Dockerfile,
138+
# but can be overridden here if needed for different weight files for the same image:
139+
# - DEFAULT_MODEL_VARIANT="cross_efficient_vit"
140+
# - CROSS_EFFICIENT_VIT_MODEL_PATH="/app/model_code/cross-efficient-vit/pretrained_models/cross_efficient_vit.pth"
141+
# - EFFICIENT_VIT_MODEL_PATH="/app/model_code/efficient-vit/pretrained_models/efficient_vit.pth"
142+
# - CROSS_EFFICIENT_VIT_CONFIG_PATH="/app/model_code/cross-efficient-vit/configs/architecture.yaml"
143+
# - EFFICIENT_VIT_CONFIG_PATH="/app/model_code/efficient-vit/configs/architecture.yaml"
144+
# - FRAMES_PER_VIDEO="15" # If you want to control frame sampling from docker-compose
66145
networks:
67146
- deepsafe-network
147+
# Optional: Add resource limits for CPU/memory if this model is resource-intensive
148+
# deploy:
149+
# resources:
150+
# limits:
151+
# cpus: '2.0'
152+
# memory: 4G
68153

69-
# --- Audio Model Services ---
70-
vocoder_artifacts:
71-
build: ./models/audio/vocoder_artifacts
72-
container_name: deepsafe-vocoder-artifacts
73-
ports:
74-
- "8001:8001"
75-
restart: unless-stopped
76-
environment:
77-
- MODEL_PORT=8001
78-
- PRELOAD_MODEL=false
79-
- MODEL_TIMEOUT=600
80-
- USE_GPU=false
81-
volumes:
82-
- ./models/audio/vocoder_artifacts/models:/app/models:ro
83-
networks:
84-
- deepsafe-network
154+
# --- Placeholder for future audio model service ---
155+
# example_audio_model_1:
156+
# build: ./models/audio/example_audio_model_1
157+
# container_name: deepsafe-example-audio-model-1
158+
# ports:
159+
# - "8001:8001"
160+
# restart: unless-stopped
161+
# # ... environment ...
162+
# networks:
163+
# - deepsafe-network
85164

86165
frontend:
87166
build: ./frontend
88167
container_name: deepsafe-frontend
89168
ports:
90-
- "80:80"
169+
- "8888:80"
91170
restart: unless-stopped
92171
depends_on:
93172
- api
@@ -96,4 +175,4 @@ services:
96175

97176
networks:
98177
deepsafe-network:
99-
driver: bridge
178+
driver: bridge

docs/images/dashboard.png

91.2 KB
Loading

docs/images/login_page.png

285 KB
Loading

models/video/cross_efficient_vit/Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ ENV QT_QPA_PLATFORM=offscreen
2828
COPY requirements.txt .
2929

3030
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
31-
pip install uv && \
32-
uv pip install --system --no-cache-dir \
31+
pip install --no-cache-dir \
3332
torch==1.11.0 \
3433
torchvision==0.12.0 \
3534
torchaudio==0.11.0 \
@@ -38,11 +37,11 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
3837
# NumPy version will be handled by requirements.txt now
3938
# REMOVE THIS LINE: RUN pip install --no-cache-dir numpy==1.21.6
4039

41-
RUN uv pip install --system --no-cache-dir opencv-python-headless==4.6.0.66
40+
RUN pip install --no-cache-dir opencv-python-headless==4.6.0.66
4241

4342
# Install other Python dependencies from requirements.txt
4443
# This will install numpy as per the constraint in requirements.txt
45-
RUN uv pip install --system --no-cache-dir -r requirements.txt
44+
RUN pip install --no-cache-dir -r requirements.txt
4645

4746
# ... (rest of your Dockerfile remains the same) ...
4847

@@ -58,14 +57,14 @@ RUN mkdir -p /app/model_code/efficient-vit/pretrained_models && \
5857

5958
# Move downloaded weights to their respective locations
6059
RUN if [ -f /app/model_code/gdrive_weights/efficient_vit.pth ]; then \
61-
mv /app/model_code/gdrive_weights/efficient_vit.pth /app/model_code/efficient-vit/pretrained_models/efficient_vit.pth; \
60+
mv /app/model_code/gdrive_weights/efficient_vit.pth /app/model_code/efficient-vit/pretrained_models/efficient_vit.pth; \
6261
else \
63-
echo "Warning: efficient_vit.pth not found in gdrive_weights, assuming it might be part of the repo or handled differently." ; \
62+
echo "Warning: efficient_vit.pth not found in gdrive_weights, assuming it might be part of the repo or handled differently." ; \
6463
fi && \
6564
if [ -f /app/model_code/gdrive_weights/cross_efficient_vit.pth ]; then \
66-
mv /app/model_code/gdrive_weights/cross_efficient_vit.pth /app/model_code/cross-efficient-vit/pretrained_models/cross_efficient_vit.pth; \
65+
mv /app/model_code/gdrive_weights/cross_efficient_vit.pth /app/model_code/cross-efficient-vit/pretrained_models/cross_efficient_vit.pth; \
6766
else \
68-
echo "Warning: cross_efficient_vit.pth not found in gdrive_weights, assuming it might be part of the repo or handled differently." ; \
67+
echo "Warning: cross_efficient_vit.pth not found in gdrive_weights, assuming it might be part of the repo or handled differently." ; \
6968
fi && \
7069
rm -rf /app/model_code/gdrive_weights
7170

0 commit comments

Comments
 (0)