import streamlit as st import os.path os.system("mkdir _input") os.system("mkdir _output") os.system("mkdir _outputf") os.system("ls") if not os.path.isfile("./_input/imagem-0001.png"): os.system("ffmpeg -i vivi.mp4 -compression_level 10 -pred mixed -pix_fmt rgb24 -sws_flags +accurate_rnd+full_chroma_int -s 1080x1920 -r 0.12 ./_input/imagem-%4d.png") os.system("ls ./_input") if 'myVar' not in globals(): myVar="" # os.system("pip install git+https://github.com/TencentARC/GFPGAN.git") os.system("python3 inference_gfpgan.py -i _input -o _output -v 1.3 -s 4") import cv2 import random os.system("ls ./_output") os.system("echo ----") os.system("ls ./_output/cmp") os.system("echo ----") os.system("ls ./_output/restored_imgs") os.system("echo ----") def inference(): random.randint(0, 9) input_img = cv2.imread("./_output/cmp/imagem-000"+str(random.randint(1, 4))+"_0000.png" , cv2.IMREAD_COLOR) input_img= cv2.cvtColor(input_img,cv2.COLOR_BGR2RGB) st.image(input_img) #return Image.fromarray(restored_faces[0][:,:,::-1]) title = "Melhoria de imagens" os.system("ls") description = "Sistema para automação。" article = "

clone from akhaliq@huggingface with little change | GFPGAN Github Repo

visitor badge
" st.button('Comparacao',on_click=inference)