from fastapi import FastAPI,Cookie, Depends, Query, status,File, UploadFile,Request,Response,HTTPException import threading import rpyc import random import time import math import hashlib import re from fastapi.middleware.cors import CORSMiddleware import dataset from datetime import datetime, timedelta from util.swap_face import swap_face from fastapi.staticfiles import StaticFiles import io from first import first import models import pymysql import traceback import logging import util.user mode = 'run' app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) pymysql.install_as_MySQLdb() app = FastAPI()