Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ description = "Sistema para automação。"
|
|
18 |
st.header(description)
|
19 |
article = "<p style='text-align: center'><a href='https://huggingface.co/spaces/akhaliq/GFPGAN/' target='_blank'>clone from akhaliq@huggingface with little change</a> | <a href='https://github.com/TencentARC/GFPGAN' target='_blank'>GFPGAN Github Repo</a></p><center><img src='https://visitor-badge.glitch.me/badge?page_id=akhaliq_GFPGAN' alt='visitor badge'></center>"
|
20 |
#-s 720x1280
|
21 |
-
@st.experimental_memo(suppress_st_warning=
|
22 |
def chamada():
|
23 |
percent_complete=0
|
24 |
my_bar = st.progress(0)
|
@@ -26,13 +26,13 @@ def chamada():
|
|
26 |
with col1:
|
27 |
my_bar.progress(percent_complete )
|
28 |
#exec=True
|
29 |
-
st.write("ffmpeg separando imagens")
|
30 |
#if not os.path.isfile("./_input/imagem-0001.png"):
|
31 |
os.system("ffmpeg -i vivi.mp4 -compression_level 10 -pred mixed -pix_fmt rgb24 -sws_flags +accurate_rnd+full_chroma_int -s 1480x2560 -r 30 ./_input/imagem-%4d.png")
|
32 |
percent_complete= percent_complete+ 30
|
33 |
with col1:
|
34 |
my_bar.progress(percent_complete )
|
35 |
-
|
36 |
input_img = cv2.imread("./_input/imagem-0002.png" , cv2.IMREAD_COLOR)
|
37 |
input_img= cv2.cvtColor(input_img,cv2.COLOR_BGR2RGB)
|
38 |
with col1:
|
@@ -41,7 +41,7 @@ def chamada():
|
|
41 |
os.system("ls ./_input")
|
42 |
if 'myVar' not in globals():
|
43 |
myVar=""
|
44 |
-
|
45 |
with col2:
|
46 |
with st.spinner('Wait for it...'):
|
47 |
# os.system("pip install git+https://github.com/TencentARC/GFPGAN.git")
|
@@ -57,14 +57,14 @@ def chamada():
|
|
57 |
os.system("ls ./_output/restored_imgs")
|
58 |
os.system("echo ----")
|
59 |
# s 1480x2560
|
60 |
-
|
61 |
-
|
62 |
#ffmpeg -r 60 -f image2 -s 1920x1080 -i _output/restored_imgs/imagem-%4d.png -pix_fmt yuv420p ./videoSaida/output.mp4
|
63 |
os.system("ffmpeg -y -r 30 -f image2 -i _output/restored_imgs/imagem-%4d.png -pix_fmt yuv420p ./videoSaida/output.mp4")
|
64 |
os.system("ls ./videoSaida")
|
65 |
#st.video("./videoSaida/output.mp4" )
|
66 |
with col1:
|
67 |
-
|
68 |
percent_complete= percent_complete+ 30
|
69 |
my_bar.progress(percent_complete )
|
70 |
with col2:
|
@@ -87,7 +87,7 @@ def chamada():
|
|
87 |
#input_img = cv2.imread("./_output/cmp/imagem-0001_0000.png" , cv2.IMREAD_COLOR)
|
88 |
#input_img = cv2.imread("./_output/cmp/imagem-0001_0000.png" , cv2.IMREAD_COLOR)
|
89 |
with col2:
|
90 |
-
|
91 |
input_img = cv2.imread("./_output/restored_imgs/imagem-0002.png" , cv2.IMREAD_COLOR)
|
92 |
input_img= cv2.cvtColor(input_img,cv2.COLOR_BGR2RGB)
|
93 |
|
|
|
18 |
st.header(description)
|
19 |
article = "<p style='text-align: center'><a href='https://huggingface.co/spaces/akhaliq/GFPGAN/' target='_blank'>clone from akhaliq@huggingface with little change</a> | <a href='https://github.com/TencentARC/GFPGAN' target='_blank'>GFPGAN Github Repo</a></p><center><img src='https://visitor-badge.glitch.me/badge?page_id=akhaliq_GFPGAN' alt='visitor badge'></center>"
|
20 |
#-s 720x1280
|
21 |
+
@st.experimental_memo(suppress_st_warning=True)
|
22 |
def chamada():
|
23 |
percent_complete=0
|
24 |
my_bar = st.progress(0)
|
|
|
26 |
with col1:
|
27 |
my_bar.progress(percent_complete )
|
28 |
#exec=True
|
29 |
+
# st.write("ffmpeg separando imagens")
|
30 |
#if not os.path.isfile("./_input/imagem-0001.png"):
|
31 |
os.system("ffmpeg -i vivi.mp4 -compression_level 10 -pred mixed -pix_fmt rgb24 -sws_flags +accurate_rnd+full_chroma_int -s 1480x2560 -r 30 ./_input/imagem-%4d.png")
|
32 |
percent_complete= percent_complete+ 30
|
33 |
with col1:
|
34 |
my_bar.progress(percent_complete )
|
35 |
+
# st.write("testando imagem")
|
36 |
input_img = cv2.imread("./_input/imagem-0002.png" , cv2.IMREAD_COLOR)
|
37 |
input_img= cv2.cvtColor(input_img,cv2.COLOR_BGR2RGB)
|
38 |
with col1:
|
|
|
41 |
os.system("ls ./_input")
|
42 |
if 'myVar' not in globals():
|
43 |
myVar=""
|
44 |
+
# st.write("melhorando faces")
|
45 |
with col2:
|
46 |
with st.spinner('Wait for it...'):
|
47 |
# os.system("pip install git+https://github.com/TencentARC/GFPGAN.git")
|
|
|
57 |
os.system("ls ./_output/restored_imgs")
|
58 |
os.system("echo ----")
|
59 |
# s 1480x2560
|
60 |
+
# with col1:
|
61 |
+
# st.write("recompilando video")
|
62 |
#ffmpeg -r 60 -f image2 -s 1920x1080 -i _output/restored_imgs/imagem-%4d.png -pix_fmt yuv420p ./videoSaida/output.mp4
|
63 |
os.system("ffmpeg -y -r 30 -f image2 -i _output/restored_imgs/imagem-%4d.png -pix_fmt yuv420p ./videoSaida/output.mp4")
|
64 |
os.system("ls ./videoSaida")
|
65 |
#st.video("./videoSaida/output.mp4" )
|
66 |
with col1:
|
67 |
+
# st.write("preparando para download do video")
|
68 |
percent_complete= percent_complete+ 30
|
69 |
my_bar.progress(percent_complete )
|
70 |
with col2:
|
|
|
87 |
#input_img = cv2.imread("./_output/cmp/imagem-0001_0000.png" , cv2.IMREAD_COLOR)
|
88 |
#input_img = cv2.imread("./_output/cmp/imagem-0001_0000.png" , cv2.IMREAD_COLOR)
|
89 |
with col2:
|
90 |
+
# st.write("demonstrando imagem restaurada")
|
91 |
input_img = cv2.imread("./_output/restored_imgs/imagem-0002.png" , cv2.IMREAD_COLOR)
|
92 |
input_img= cv2.cvtColor(input_img,cv2.COLOR_BGR2RGB)
|
93 |
|