Traditional Deepfake detection focuses on Deepfake detection for an unspecified number of people.
These are ways to improve the performance of benchmark dataset in Deepfake detection competitions.
Therefore, these methods do not take into account the actual service situation.
Accordingly, we propose a model structure that improves the performance of the detection model by few shot learning a small amount of victim pictures.
Finally, we would like to provide the model-based deepfake detection service 'Fakey' to prevent the abuse of deepfake.
- region: asia-northeast3-b
- GPU: Nvidia-T4, num:1 (GPU mem:GDDR6 16GB)
- CPU: n1-standard-4(vCPU 4개, 15GB 메모리)
- Boot-disk: Ubuntu20.04LTS 50GB
- database engine: MySQL 8.0.31
- vCPU:2, 8GB 메모리
- Disk: SSD 50GB
├─backend
├─checkpoints
├─datas
├─deepfake
├─docs
├─frontend
├─MobileFaceSwap
└─source
-
call for GPU allocation [참고]: https://kim6394.tistory.com/98
-
GCP config
region: asia-northeast3-b
GPU: Nvidia-T4, num:1
CPU: n1-standard-4(vCPU 4개, 15GB 메모리)
Boot-disk: Ubuntu20.04LTS at least 30GB
Firewall: allow all
-
make SSH-key & add metadata & access with VSCode to GCE
follow this link to make key by puttygen(don't need private key)https://amanokaze.github.io/blog/Connect-GCE-using-VS-Code/ -
install cuda
sudo apt install ubuntu-drivers-common -y
sudo apt install nvidia-driver-515 -y
wget https://developer.download.nvidia.com/compute/cuda/11.7.0/local_installers/cuda_11.7.0_515.43.04_linux.run
if above link expired find appropriate version in this link https://developer.nvidia.com/cuda-toolkit-archive
sudo sh cuda_11.7.0_515.43.04_linux.run
need to wait long time
remember checkout Driver!
- update .bashrc
add this to /home/USERNAME/.bashrc
export PATH=/usr/local/cuda-11.7/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
- run bashrc
source ~/.bashrc
- check installed CUDA
nvcc --version
- download cudnn fron oneDrive
filename is cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.zip - install cudnn
tar -xvf cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz
sudo cp cudnn-linux-x86_64-8.5.0.96_cuda11-archive/include/cudnn*.h /usr/local/cuda/include
sudo cp -P cudnn-linux-x86_64-8.5.0.96_cuda11-archive/lib/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*
- check installed cudnn
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2
- reboot to apply changes
sudo reboot
- download conda
wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh
- install conda
bash Anaconda3-2020.07-Linux-x86_64.sh
check "yes" at here - run bashrc
source ~/.bashrc
- make virtual env
conda create -n final python=3.9.7
conda activate final
- install mysql
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
- clone our github and cd move to it
git clone https://github.com/boostcampaitech5/level3_cv_finalproject-cv-11.git
after this move to develop branch and pull - install requirements without dependencies
pip install -r requirements.txt --no-deps
- start mysql server
sudo service mysql start
- make root user & make user_db database
sudo mysqladmin -u root create user_db -p
- import default tables
for localhost
sudo mysql -u root -p user_db < {home_path}/level3_cv_finalproject-cv-11/deepfake.sql
for Cloud SQL
sudo mysql -u root -p user_db -h {your cloud sql ip} < {home_path}/level3_cv_finalproject-cv-11/deepfake.sql
-
connect mysql with root user
sudo mysql -u root -p
-
change mysql security setting for connection
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '1234';
FLUSH PRIVILEGES;
-
finally set backend/routers/database.py for your database setting
in 5~6 line in backend/routers/database.py
SQLALCHEMY_DATABASE_URL = "mysql://root:1234@localhost:3306/user_db?charset=utf8" #change user user, password for localhost mysql setting
SQLALCHEMY_DATABASE_URL = "mysql://root:1234@34.64.189.15:3306/user_db?charset=utf8" #For my cloud SQL server