Skip to content

Instantly share code, notes, and snippets.

@jgwill
Last active July 8, 2023 16:34
Show Gist options
  • Save jgwill/25a81f5e72e00d425ba9891330a61a29 to your computer and use it in GitHub Desktop.
Save jgwill/25a81f5e72e00d425ba9891330a61a29 to your computer and use it in GitHub Desktop.
giaupscayl-prototyping-2307-infraless
input_file=test-img-lowres.jpg
output_base=_test-img-lowres-upres-gia
model_name="realesrgan-x4plus-anime"
#Init
sudo mkdir -p -m 777 /repos
cd /repos && git clone https://github.com/GuillaumeAI/giar-Real-ESRGAN.git \
&& cd giar-Real-ESRGAN
# Python version
python --version
# SETUP see : https://gist.github.com/jgwill/77178d1ab8499af65cc88ed4dec39b4d
# Test UPSCAYL
python inference_realesrgan.py -n $model_name -i $input_file -o $output_base'-pyori.png' --tile 100
python gia_inference_realesrgan.py -i $input_file -o $output_base'-pygia.png'
#######################################################################################
# Test with bin/realsrgan/realesrgan-ncnn-vulkan
mkdir -p -m 777 /repos
cd /repos && git clone https://github.com/GuillaumeAI/gia-upscayl.git \
&& cd gia-upscayl
model_path=$(pwd)/bin/realsrgan/models
## Working ??
bin/realsrgan/realesrgan-ncnn-vulkan \
&& echo "WORKING :)" || echo " NOT WORKING :("
bin/realsrgan/realesrgan-ncnn-vulkan \
-i $input_file \
-o $output_base'-bin-realsrgan-vulkan.png' \
-n $model_name \
-m $model_path \
-v
# Test with : resources/linux/bin/upscayl-realesrgan
model_path=$(pwd)/resources/linux/bin/upscayl-realesrgan/models
# working ??
resources/linux/bin/upscayl-realesrgan \
&& echo "WORKING :)" || echo "resources/linux/bin/upscayl-realesrgan NOT WORKING :("
resources/linux/bin/upscayl-realesrgan \
-i $input_file \
-o $output_base'-resource-linux-oribin-upscayl.png' \
-n $model_name \
-m $model_path \
-v
#REF : https://techviewleo.com/how-to-install-python-on-amazon-linux-2/?expand_article=1
sudo yum update -y
sudo yum groupinstall "Development Tools" -y
sudo yum erase openssl-devel -y
sudo yum install openssl11 openssl11-devel libffi-devel bzip2-devel wget -y
# Download and build python
cd
wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz
tar -xf Python-3.10.4.tgz \
&& cd Python-3.10.4/ \
&& ./configure --enable-optimizations \
&& make -j $(nproc) \
&& sudo make altinstall
python3.10 --version
@jgwill
Copy link
Author

jgwill commented Jul 8, 2023

Amazon linux
bin/realsrgan/realesrgan-ncnn-vulkan: error while loading shared libraries: libvulkan.so.1: cannot open shared object file: No such file or directory
NOT WORKING :(

@jgwill
Copy link
Author

jgwill commented Jul 8, 2023

Building the Python 3.10 to see if that will works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment