Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import os.path
|
|
|
|
| 3 |
os.system("mkdir _input")
|
| 4 |
os.system("mkdir _output")
|
| 5 |
os.system("mkdir _outputf")
|
|
@@ -8,8 +9,10 @@ if not os.path.isfile("./_input/imagem-0001.png"):
|
|
| 8 |
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")
|
| 9 |
|
| 10 |
os.system("ls ./_input")
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
os.system("pip install git+https://github.com/TencentARC/GFPGAN.git")
|
| 13 |
import cv2
|
| 14 |
import glob
|
| 15 |
import numpy as np
|
|
@@ -30,12 +33,14 @@ import torch
|
|
| 30 |
# set up GFPGAN restorer
|
| 31 |
bg_upsampler = None
|
| 32 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 33 |
-
restorer
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
|
|
|
|
|
|
| 39 |
|
| 40 |
img_list = sorted(glob.glob(os.path.join("./_input", '*')))
|
| 41 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import os.path
|
| 3 |
+
|
| 4 |
os.system("mkdir _input")
|
| 5 |
os.system("mkdir _output")
|
| 6 |
os.system("mkdir _outputf")
|
|
|
|
| 9 |
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")
|
| 10 |
|
| 11 |
os.system("ls ./_input")
|
| 12 |
+
if 'myVar' not in globals():
|
| 13 |
+
myVar=""
|
| 14 |
+
os.system("pip install git+https://github.com/TencentARC/GFPGAN.git")
|
| 15 |
|
|
|
|
| 16 |
import cv2
|
| 17 |
import glob
|
| 18 |
import numpy as np
|
|
|
|
| 33 |
# set up GFPGAN restorer
|
| 34 |
bg_upsampler = None
|
| 35 |
print(f"Is CUDA available: {torch.cuda.is_available()}")
|
| 36 |
+
if 'restorer' not in globals():
|
| 37 |
+
restorer = GFPGANer(
|
| 38 |
+
model_path='GFPGANv1.3.pth',
|
| 39 |
+
upscale=2,
|
| 40 |
+
arch='clean',
|
| 41 |
+
channel_multiplier=2,
|
| 42 |
+
bg_upsampler=bg_upsampler)
|
| 43 |
+
|
| 44 |
|
| 45 |
img_list = sorted(glob.glob(os.path.join("./_input", '*')))
|
| 46 |
|