#!/bin/bash

# Update package lists
apt update

# Clone the roop repository
git clone https://github.com/FurkanGozukara/roop

# Change directory to roop
cd roop

# Checkout a specific commit - you can remove this line to install latest version
#git checkout 3d02b267663e4badc5c7936d5295effcae3dfbc0

# Create a Python virtual environment
python3 -m venv venv

# Activate the virtual environment
source venv/bin/activate

# Install onnxruntime-gpu and requirements
pip install onnxruntime-gpu && pip install -r req_runpod.txt

pip install onnxruntime-gpu --upgrade

# Install python3.10-tk package
yes | apt-get install -y python3.10-tk

yes | apt-get install ffmpeg

yes | apt-get install p7zip-full

# Install specific versions of libcudnn8
yes | apt install -y libcudnn8=8.7.0.84-1+cuda11.8 libcudnn8-dev=8.7.0.84-1+cuda11.8 --allow-change-held-packages

pip install opennsfw2 keras --upgrade
