Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
46e7c32
Delete dummy upload files
ieeyesoi May 8, 2026
7e5180e
✨ Create perturbation_explainer.py
SEOYUNJE May 8, 2026
102ef57
✨ Create misc_explainer.py
SEOYUNJE May 8, 2026
065a228
📝 Add __repr__ for all explainer classes
SEOYUNJE May 8, 2026
857b308
✨ Add _resolve_block_idx
SEOYUNJE May 9, 2026
c1dd941
💚 Add PR CI workflow with ruff lint and pytest
SEOYUNJE May 9, 2026
c9f1041
💚 Add PR auto-labeler with path-based label rules
SEOYUNJE May 9, 2026
b84b267
✨ Add cam_mult_image.py for testing
SEOYUNJE May 9, 2026
cf97ec7
✨ Add perturbation_confidence.py for testing
SEOYUNJE May 9, 2026
92c3007
✨ Add road.py for testing
SEOYUNJE May 9, 2026
f060223
⚰️ Remove SegEigenCAM
SEOYUNJE May 11, 2026
36b5049
⚰️ Remove AblationCAM
SEOYUNJE May 11, 2026
d243356
✨ Add remove_padding_and_resize
SEOYUNJE May 11, 2026
294c715
♻️ Refactor display_heatmap with new arguements
SEOYUNJE May 11, 2026
fc436b8
✨ Add display_contour_on_image
SEOYUNJE May 11, 2026
3a6b9bb
✨ Add display_bbox_on_image
SEOYUNJE May 11, 2026
62561dd
✨ Add BinaryClassifierOutputSigmoidTarget
SEOYUNJE May 11, 2026
0f01452
Bind refactory
HanMoonSub May 12, 2026
01cc4fe
✨ Create CAMEvaluator
SEOYUNJE May 12, 2026
d67a426
🎨 Add Reproductability for same result
SEOYUNJE May 13, 2026
9d0ce5b
🚚 Move base,cam,gradient,eigenvalue,perturbation,misc explainer.py to…
SEOYUNJE May 13, 2026
8c43e5e
✨ Create cam router for DeepFake XAI
SEOYUNJE May 13, 2026
ef7fb4c
🔥 Remove legacy file(setup.py)
SEOYUNJE May 13, 2026
91d4981
✨ Create pyproject.toml
SEOYUNJE May 13, 2026
27066ad
🚚 Rename Cam Router -> Explain Router
SEOYUNJE May 14, 2026
573ab4b
✨ Create explain_image
SEOYUNJE May 14, 2026
00a8416
🎨 Add response_class & response_model in inference routes
SEOYUNJE May 14, 2026
31be8c1
Annotation
HanMoonSub May 14, 2026
05a894d
Add Summary info in routes folder
HanMoonSub May 14, 2026
40308b9
Add delete_video_frame_result and delete_video_meta_result
HanMoonSub May 14, 2026
302aca4
📝 Add python-dotenv & cryptography
SEOYUNJE May 15, 2026
c8e5566
⚰️ Remove debugging print in upload_video, delete_video
SEOYUNJE May 15, 2026
b430278
✨ Add validation and description to image, video inference params
SEOYUNJE May 15, 2026
13bb4c6
⚰️ Remove Debugging print upload_image, delete_image
SEOYUNJE May 15, 2026
da1ab75
✨ Create ExplainRequest
SEOYUNJE May 15, 2026
086af00
♻️ Refactor BinaryClassifierOutputSigmoidTarget with removing category
SEOYUNJE May 15, 2026
b6bfd16
✨ Create PNGStreamingResponse(media_type="image/png")
SEOYUNJE May 15, 2026
dd81bba
✨ Create explain_svc.py
SEOYUNJE May 16, 2026
bc55e95
🎨 Add threshold argument in ExplainRequest
SEOYUNJE May 16, 2026
1b12a80
✨ Add DeepFake AI Explainability
SEOYUNJE May 16, 2026
4942477
🧹 Slim cache key to (model, dataset, type, branch)
SEOYUNJE May 16, 2026
8043fc6
✨ Add validate_explainer_for_eigen_smooth
SEOYUNJE May 19, 2026
14206fb
Fix
ieeyesoi May 19, 2026
f25176b
refactor: improve anonymous cleanup logic and standardize service com…
HanMoonSub May 19, 2026
cfee097
⚡️ Include explain_svc, image_svc, video_svc in celery_app
SEOYUNJE May 20, 2026
667e93c
✨ Add get_explain_image_result
SEOYUNJE May 20, 2026
7efe4e1
✨ Add cleanup_image_cam
SEOYUNJE May 20, 2026
8b89a07
✨ Add process_explain_image_task
SEOYUNJE May 20, 2026
1aa3e14
⚡️ Add Celery Task Status(STARTED, RETRY)
SEOYUNJE May 20, 2026
bf2a7b0
⚰️ Remove is_deleted flag in cleanup_image_cam
SEOYUNJE May 20, 2026
a64a483
🚚 Rename ExplainRequest to ExplainImageRequest
SEOYUNJE May 20, 2026
aabfc70
✨ Add _get_transform_from_array
SEOYUNJE May 21, 2026
3474cb8
🔥 Remove contour display type from image explainability
SEOYUNJE May 21, 2026
4b59f54
📝 Update __repr__ with removing unnecessary argument
SEOYUNJE May 21, 2026
d8fafd9
✨ Add display_heatmap_from_array, display_bbox_from_array
SEOYUNJE May 21, 2026
8000371
Delay Function Refectoring
HanMoonSub May 21, 2026
15a1a27
Merge pull request #47 from HanMoonSub/feature/video2-cam
SEOYUNJE May 21, 2026
190eb5d
Merge branch 'feature/video2' into feature/video2-upload
HanMoonSub May 21, 2026
906f673
Merge pull request #48 from HanMoonSub/feature/video2-upload
HanMoonSub May 21, 2026
9cacc71
🔥 Remove static/upload unnecessary files
HanMoonSub May 21, 2026
da10328
♻️ Refactor is_success flag in cleanup_anonymous_video
HanMoonSub May 21, 2026
3bea602
Implementation of image deletion
ieeyesoi May 21, 2026
385f990
View Original Images
ieeyesoi May 21, 2026
ca34752
Add VideoTimelinePage
ieeyesoi May 21, 2026
cb3b9fb
🔥 Remove Video Folder
SEOYUNJE May 22, 2026
49fde69
🚚 Rename Image folders to docs folders
SEOYUNJE May 22, 2026
7fc656c
⚡️ Improve Bbox Design and Robust Bbox Noise
SEOYUNJE May 22, 2026
f400ccb
✨ Add draw_label, show_bbox_on_image
SEOYUNJE May 22, 2026
2addb93
✨ Add display_heatmap_bbox_on_image, display_heatmap_bbox_on_image_fr…
SEOYUNJE May 22, 2026
d88fd05
✨ Add heatmap+bbox display type from image explainability
SEOYUNJE May 22, 2026
468f609
🔥 Remove legacy file (labels.txt)
SEOYUNJE May 23, 2026
586fea0
➕ Add Field descriptions and correct delete function arguments on FAI…
HanMoonSub May 25, 2026
1f9d4fa
📝 Add MS-EFF-GCVIT Visual Result
SEOYUNJE May 23, 2026
3c3cd27
Fix VideoTimeLinePage detail
ieeyesoi May 25, 2026
e71a7c5
Merge pull request #49 from HanMoonSub/feature/video2-cam
SEOYUNJE May 26, 2026
3421e8f
Merge branch 'feature/video2-cam' into feature/video2-upload
HanMoonSub May 26, 2026
db81d25
Delete uploads files
ieeyesoi May 25, 2026
6a6441f
Merge branch 'feature/video2' into feature/video2-ui
ieeyesoi May 26, 2026
e05aebe
Merge branch 'feature/video2' into feature/video2-upload
HanMoonSub May 26, 2026
edb02cc
🎨 Change Default Value in ExplainImageRequest
SEOYUNJE May 26, 2026
e2cf734
✨ Add ExplainFrameRequest
SEOYUNJE May 26, 2026
be5d224
♻️ Refacory anlaysispage.js
ieeyesoi May 27, 2026
702b390
♻️ Refactory AnalysisDetailPage.js
ieeyesoi May 27, 2026
3c09e44
♻️ Refactory VideoAnalysisPage.js
ieeyesoi May 27, 2026
d623e3e
♻️ Refacory VideoTimelinePage.js
ieeyesoi May 27, 2026
acd08ca
🎨 Delete category argument and Add model_type argument in ExplainImag…
SEOYUNJE May 27, 2026
1993f32
⚡️ Remove video duration constraint for frame extraction
SEOYUNJE May 27, 2026
202500c
✨ Add explain_frame, get_explain_frame_result
SEOYUNJE May 28, 2026
d46882b
✨ Add explain_frame, get_explain_frame_result
SEOYUNJE May 28, 2026
47c03c3
✨ Add upload_frame_cam
SEOYUNJE May 28, 2026
9b77fea
✨ Add process_explain_frame_task
SEOYUNJE May 28, 2026
9f216ae
✨ Add get_video_frame_by_index
SEOYUNJE May 28, 2026
c9982dc
🎨 Add status argument in UserHistory_indi
SEOYUNJE May 28, 2026
e3f5e39
Merge pull request #50 from HanMoonSub/feature/video2-cam
SEOYUNJE May 28, 2026
463765a
Merge pull request #51 from HanMoonSub/feature/video2-cam
SEOYUNJE May 28, 2026
3f93a3a
Merge branch 'feature/video2' into feature/video2-ui
ieeyesoi May 28, 2026
e4fc4cf
🐛 Fix Status Location in UserHistory_indi
SEOYUNJE May 28, 2026
023da30
Merge pull request #52 from HanMoonSub/feature/video2-cam
SEOYUNJE May 28, 2026
fd90f47
Merge branch 'feature/video2' into feature/video2-upload
HanMoonSub May 28, 2026
1fa876c
✏️ Fix a few bug of explain_frame
SEOYUNJE May 28, 2026
1eb4a28
📝 Convert auth_svc inline comments to docstrings
SEOYUNJE May 28, 2026
0aac933
📝 Convert explain_svc inline comments to docstrings
SEOYUNJE May 28, 2026
174913b
📝 Convert inference_svc inline comments to docstrings
SEOYUNJE May 28, 2026
3d35886
📝 Convert session_svc inline comments to docstrings
SEOYUNJE May 28, 2026
d83d7f4
📝 Convert image_svc inline comments to docstrings
SEOYUNJE May 28, 2026
2092e9e
📝 Convert video_svc inline comments to docstrings
SEOYUNJE May 28, 2026
d2fb1d2
Merge pull request #53 from HanMoonSub/feature/video2-cam
SEOYUNJE May 28, 2026
111e337
Merge branch 'feature/video2' into feature/video2-ui
ieeyesoi May 29, 2026
9039d96
📝 Add western_fake, western_real video
SEOYUNJE May 29, 2026
da8a8de
📝 Update README.md
SEOYUNJE May 29, 2026
40493d9
📝 Update README_KR.md
SEOYUNJE May 29, 2026
d98287e
📝 Add README_JP.md
SEOYUNJE May 29, 2026
f21bdfc
📝 Add FUNDING.yml for github sponsors
SEOYUNJE May 29, 2026
d4ca337
Merge pull request #54 from HanMoonSub/feature/video2-cam
SEOYUNJE May 30, 2026
3dd2460
➕ Add usage location comments to schema classes
HanMoonSub May 30, 2026
884e91e
📝 Add benchmark images and Update MS_EFFGCViT.md
SEOYUNJE May 30, 2026
22b64e1
Merge pull request #55 from HanMoonSub/feature/video2-cam
SEOYUNJE May 30, 2026
4685e72
📝 Add benchmark images and Update MS_EFFGCViT.md
SEOYUNJE May 30, 2026
2e535f9
📝 Add FUNDING.yml for github sponsors & buy me coffee
SEOYUNJE Jun 1, 2026
43195cf
📝 Add benchmark images and Update MS_EFFViT.md
SEOYUNJE Jun 1, 2026
4d08e79
Merge branch 'feature/video2' into feature/video2-cam
SEOYUNJE Jun 1, 2026
be73094
Merge pull request #56 from HanMoonSub/feature/video2-cam
SEOYUNJE Jun 1, 2026
6c6b043
🎨 Add HeatmapPage.js
ieeyesoi Jun 1, 2026
1fed55a
🔥 Delete uploads
ieeyesoi Jun 1, 2026
b7edbc5
🔧 Fix VideoTimelinePage.js
ieeyesoi Jun 2, 2026
bf42cb9
👽️ Convert inline comments to docstrings
HanMoonSub Jun 2, 2026
3457f30
🔥 Delete upload image file
HanMoonSub Jun 2, 2026
6416bcf
Merge pull request #58 from HanMoonSub/feature/video2-upload
HanMoonSub Jun 2, 2026
7068c27
🔥 Delete files
ieeyesoi Jun 2, 2026
f4edbea
Merge pull request #59 from HanMoonSub/feature/video2-ui
ieeyesoi Jun 2, 2026
e8d8bad
🐛 Trust X-Forwarded-Proto for cross-site session cookie behind ngrok
SEOYUNJE Jun 2, 2026
0f29f30
🔥 Remove unused variables flagged by ESLint
SEOYUNJE Jun 2, 2026
58e3d28
🔧 Image Heatmap
ieeyesoi Jun 3, 2026
8e07786
📝 Add predict_image.ipynb
SEOYUNJE Jun 4, 2026
b0b2eac
📝 Add predict_video.ipynb
SEOYUNJE Jun 4, 2026
d747ff9
🎨 UI Heatmap
ieeyesoi Jun 5, 2026
b302e15
🔥 Remove Uploads
ieeyesoi Jun 5, 2026
5dc6db8
📝 Add docstrings to explain_schema request classes
SEOYUNJE Jun 5, 2026
a9cafdd
♻️ Unify image_schema class names with video_schema convention
SEOYUNJE Jun 5, 2026
c1d3501
⚡️ Replace SELECT * and drop unused columns in image queries
SEOYUNJE Jun 5, 2026
32ee8d1
♻️ Consolidate axios defaults into index.js
SEOYUNJE Jun 6, 2026
c46f5bc
♻️ Use relative paths for same-origin proxy
SEOYUNJE Jun 6, 2026
0d473cb
🔧 Add setupProxy for local same-origin dev
SEOYUNJE Jun 6, 2026
2dbb78f
📝 Add client/vercel.json
SEOYUNJE Jun 6, 2026
3086656
📝 Add branch level visualization
SEOYUNJE Jun 6, 2026
887d6de
🎨 Add low/high branch and fast/pro model selection UI
ieeyesoi Jun 7, 2026
666d59c
🎨 Fix design
ieeyesoi Jun 8, 2026
fe401ef
🎨 Add Circle ratio
ieeyesoi Jun 8, 2026
364d868
Merge pull request #60 from HanMoonSub/feature/video2-ui
SEOYUNJE Jun 10, 2026
f3f520d
🚨 Remove unused state variables to resolve ESLint warnings
SEOYUNJE Jun 10, 2026
b1f001b
✨ Create vercel.json for Vercel Production
SEOYUNJE Jun 12, 2026
b421fa9
⚰️ Remove client/vercel.json for Vercel Production
SEOYUNJE Jun 12, 2026
2cadc92
✨ Allow guests to view video detail
SEOYUNJE Jun 15, 2026
031beed
📝 Add deepfake image, video examples
SEOYUNJE Jun 15, 2026
f39dc66
💄 Polish UI across analysis & detail pages
SEOYUNJE Jun 15, 2026
fd25709
♻️ Unify API routes under /api prefix
SEOYUNJE Jun 15, 2026
23e22a4
♻️ Simplify setupProxy to pass-through with /api prefix
SEOYUNJE Jun 15, 2026
a43e24a
🐛 Fix: use pathFilter so proxy preserves /api prefix (hpm v3)
SEOYUNJE Jun 15, 2026
9444f7a
🐛 Return relative static path in ImageHeatmapPage toAbsoluteUrl
SEOYUNJE Jun 15, 2026
f2b6c4b
🐛 Preserve /api prefix in vercel ngrok rewrite
SEOYUNJE Jun 15, 2026
0a287aa
✨ Send ngrok-skip-browser-warning header globally
SEOYUNJE Jun 15, 2026
421b99d
📝 Add Hugging Face Hub usage (Option C)
SEOYUNJE Jun 17, 2026
e63dfcd
📝 Delete Metrics and Evaluation for DeepFake XAI
SEOYUNJE Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: seoyunje
buy_me_a_coffee: seoyunje
31 changes: 31 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
model:
- changed-files:
- any-glob-to-any-file: ["src/model/**", "models/**", "*.pt", "*.pth"]

data:
- changed-files:
- any-glob-to-any-file: ["data/**", "datasets/**", "src/data/**"]

training:
- changed-files:
- any-glob-to-any-file: ["train*.py", "src/train/**", "configs/**"]

api:
- changed-files:
- any-glob-to-any-file: ["api/**", "routers/**", "app.py"]

test:
- changed-files:
- any-glob-to-any-file: ["tests/**", "test_*.py"]

docs:
- changed-files:
- any-glob-to-any-file: ["docs/**", "*.md", "*.rst"]

ci:
- changed-files:
- any-glob-to-any-file: [".github/**"]

dependencies:
- changed-files:
- any-glob-to-any-file: ["requirements*.txt", "pyproject.toml", "setup.py"]
14 changes: 0 additions & 14 deletions .github/workflows/issue-auto-label.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/issue-stale-clean.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PR CI

on:
pull_request:
branches: [main, develop]

jobs:
lint-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- name: Install dependencies
run: pip install -r requirements.txt

- name: Lint (ruff)
run: ruff check . --output-format=github

- name: Format check (ruff)
run: ruff format --check .

- name: Test (pytest)
run: pytest --tb=short -q
18 changes: 18 additions & 0 deletions .github/workflows/pr-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR Auto Label

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
sync-labels: true # PR 파일 변경 시 라벨 재동기화
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*.egg-info

# [FastAPI / Python - App 폴더 관련]
**/__pycache__/
Expand Down
16 changes: 6 additions & 10 deletions App/celery_app.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import os
import sys
from pathlib import Path
from celery import Celery
from dotenv import load_dotenv

current_file = Path(__file__).resolve()
project_root = current_file.parent.parent

if str(project_root) not in sys.path:
sys.path.insert(0, str(project_root))

# ------ .env 파일 가져오기 ------
load_dotenv()

# 기본값 설정
REDIS_HOST = os.getenv("REDIS_HOST", "localhost")
REDIS_PORT = os.getenv("REDIS_PORT", 6379)

Expand All @@ -23,7 +15,11 @@
"deepguard",
broker=REDIS_URL, # 메세지를 전달할 브로커
backend=REDIS_URL, # 작업 결과를 저장할 백엔드
include=["services.inference_svc"] # 비동기 추론 작업 파일
# 비동기 추론 작업 파일
include=["services.inference_svc", # process_image_task, process_video_task
"services.explain_svc", # process_explain_image_task
"services.image_svc", # cleanup_anonymous_image, cleanup_image_cam
"services.video_svc"] # cleanup_anonymous_video
)

# Celery Instance 상세 설정
Expand Down
45 changes: 16 additions & 29 deletions App/main.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,35 @@
import os
import sys
from pathlib import Path
import warnings
import logging
from dotenv import load_dotenv

# ------ 상위 폴더 경로 설정 --------
current_file = Path(__file__).resolve()
project_root = current_file.parent.parent # App의 상위 폴더

if str(project_root) not in sys.path:
sys.path.insert(0, str(project_root))

# ------ .env 파일 가져오기 ------
load_dotenv()

# -------- Huggingface_Hub 인증 ----------
if os.getenv("HF_TOKEN"):
os.environ["HF_TOKEN"] = os.getenv("HF_TOKEN")
else:
print("[Warning] HF_TOKEN is not set")

from fastapi import FastAPI

Check failure on line 13 in App/main.py

View workflow job for this annotation

GitHub Actions / lint-and-test

ruff (E402)

App/main.py:13:1: E402 Module level import not at top of file
from fastapi.staticfiles import StaticFiles

Check failure on line 14 in App/main.py

View workflow job for this annotation

GitHub Actions / lint-and-test

ruff (E402)

App/main.py:14:1: E402 Module level import not at top of file
from fastapi.exceptions import RequestValidationError

Check failure on line 15 in App/main.py

View workflow job for this annotation

GitHub Actions / lint-and-test

ruff (E402)

App/main.py:15:1: E402 Module level import not at top of file
from starlette.exceptions import HTTPException as StarletteHTTPException

Check failure on line 16 in App/main.py

View workflow job for this annotation

GitHub Actions / lint-and-test

ruff (E402)

App/main.py:16:1: E402 Module level import not at top of file
from fastapi.middleware.cors import CORSMiddleware

Check failure on line 17 in App/main.py

View workflow job for this annotation

GitHub Actions / lint-and-test

ruff (E402)

App/main.py:17:1: E402 Module level import not at top of file
from starlette.middleware.sessions import SessionMiddleware
from routes import auth, home, inference, image, video
from utils.common import lifespan
from utils import exc_handler, middleware
# from starlette.middleware.sessions import SessionMiddleware
from routes import api_router

Check failure on line 19 in App/main.py

View workflow job for this annotation

GitHub Actions / lint-and-test

ruff (E402)

App/main.py:19:1: E402 Module level import not at top of file
from utils import exc_handler, middleware, common

Check failure on line 20 in App/main.py

View workflow job for this annotation

GitHub Actions / lint-and-test

ruff (E402)

App/main.py:20:1: E402 Module level import not at top of file


# 가상 인스턴스 생성
app = FastAPI(lifespan=lifespan)
# 가상 FastAPI 인스턴스 생성
app = FastAPI(lifespan=common.lifespan)

# StaticFile 등록하기
# StaticFile 등록 (이미지, 비디오 파일)
app.mount("/static", StaticFiles(directory="static"), name="static")

# Cross Origin Resource Sharing
# CORS Setup for cross-origin requests
# FrontEnd: React, BackEnd: FastAPI
origins_str = os.getenv("CORS_ALLOWED_ORIGINS")
allowed_origins = [origin.strip() for origin in origins_str.split(",")]

app.add_middleware(CORSMiddleware,
allow_origins=allowed_origins,
allow_methods=["*"],
Expand All @@ -52,16 +43,12 @@
# app.add_middleware(SessionMiddleware, secret_key=SECRET_KEY, max_age=3600)

# 세션 미들웨어 등록 - Redis 이용
app.add_middleware(middleware.RedisSessionMiddleware, max_age=7200)
app.add_middleware(middleware.RedisSessionMiddleware, max_age=3600)

# 라우터 등록
app.include_router(auth.router)
app.include_router(home.router)
app.include_router(inference.router)
app.include_router(image.router)
app.include_router(video.router)
# 라우터 등록 (View: Router, Controller: Service)
app.include_router(api_router)

# Custom HTTPException Handler
# 커스텀 예외 처리: HTTPException
app.add_exception_handler(StarletteHTTPException, exc_handler.custom_http_exception_handler)
# Custom RequestValidationError Handler
# 커스텀 예외 처리: RequestValidationError
app.add_exception_handler(RequestValidationError, exc_handler.validation_exception_handler)
15 changes: 15 additions & 0 deletions App/routes/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from fastapi import APIRouter
from routes.auth import router as auth_router
from routes.explain import router as explain_router
from routes.home import router as home_router
from routes.image import router as image_router
from routes.inference import router as inference_router
from routes.video import router as video_router

api_router = APIRouter(prefix="/api", tags=["api"])
api_router.include_router(auth_router)
api_router.include_router(explain_router)
api_router.include_router(home_router)
api_router.include_router(image_router)
api_router.include_router(inference_router)
api_router.include_router(video_router)
14 changes: 7 additions & 7 deletions App/routes/auth.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
from pydantic import BaseModel

Check failure on line 1 in App/routes/auth.py

View workflow job for this annotation

GitHub Actions / lint-and-test

ruff (F401)

App/routes/auth.py:1:22: F401 `pydantic.BaseModel` imported but unused help: Remove unused import: `pydantic.BaseModel`
from fastapi import APIRouter, Depends, status, Request
from services import auth_svc, session_svc
from sqlalchemy import Connection
from db.database import context_get_conn
from fastapi.exceptions import HTTPException
from fastapi.responses import JSONResponse
from schemas.auth_schema import RegisterRequest, LoginRequest

router = APIRouter(prefix="/auth", tags=["auth"])

# --- 로그인 상태 확인 API ---
# 프론트엔드 새로고침 시 세션 유지 여부를 확인하고 유저 정보를 반환합니다
@router.get("/check", status_code=status.HTTP_200_OK)
@router.get("/check", status_code=status.HTTP_200_OK, response_class=JSONResponse, summary= "로그인 상태 확인 API")
async def check_session(session_user = Depends(session_svc.get_session_user_opt)):
return {"user": session_user}

# --- 회원가입 API ---
@router.post("/register", status_code=status.HTTP_201_CREATED)

@router.post("/register", status_code=status.HTTP_201_CREATED,response_class=JSONResponse, summary="회원가입 API")
async def register_user(request: Request,
user_info: RegisterRequest,
conn: Connection = Depends(context_get_conn)):
Expand All @@ -40,8 +41,7 @@

return {"message": "회원가입이 성공적으로 완료되었습니다.", "status": "success"}

# --- 로그인 API ---
@router.post("/login", status_code=status.HTTP_200_OK)
@router.post("/login", status_code=status.HTTP_200_OK,response_class=JSONResponse ,summary="로그인 API")
async def login_user(request: Request,
login_info: LoginRequest,
conn: Connection = Depends(context_get_conn)):
Expand Down Expand Up @@ -73,7 +73,7 @@
"status": "success"
}

@router.get("/logout", status_code=status.HTTP_200_OK)
@router.get("/logout", status_code=status.HTTP_200_OK, response_class=JSONResponse, summary="로그아웃")
async def logout_user(request: Request):
request.state.session.clear()
return {
Expand Down
Loading
Loading