Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.experimental.useTsgo": true
}
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

from src.middleware.auth import get_api_key
from src.shared.shared import access_token, default_model_name
from src.api import video_classification

# Set up logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

app = FastAPI()
app.include_router(video_classification.router)

classifier: Optional[pipeline] = None

Expand Down
18 changes: 18 additions & 0 deletions src/api/video_classification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from fastapi import APIRouter, UploadFile, File, HTTPException, Depends
from src.middleware.auth import get_api_key

router = APIRouter()


@router.post("/api/classify-video", dependencies=[Depends(get_api_key)])
async def classify_video(
file: UploadFile = File(...),
every_n_frame: int = 3,
score_threshold: float = 0.7,
max_workers: int = None,
label: str = "nsfw",
):
try:
return "hello"
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))