Spaces:
Running
on
L4
Running
on
L4
update visitor badge.
Browse files
app.py
CHANGED
@@ -114,12 +114,12 @@ def inference(image, background_enhance, face_upsample, upscale, codeformer_fide
|
|
114 |
img = cv2.imread(str(image), cv2.IMREAD_COLOR)
|
115 |
print('\timage size:', img.shape)
|
116 |
|
117 |
-
upscale = int(upscale) #
|
118 |
-
if upscale > 4: # avoid
|
119 |
upscale = 4
|
120 |
-
if upscale > 2 and max(img.shape[:2])>1000: # avoid
|
121 |
upscale = 2
|
122 |
-
if max(img.shape[:2]) > 1500: # avoid
|
123 |
upscale = 1
|
124 |
background_enhance = False
|
125 |
face_upsample = False
|
@@ -250,7 +250,7 @@ If you have any questions, please feel free to reach me out at <b>shangchenzhou@
|
|
250 |
<a href="https://github.com/sczhou"><img style="margin-top:0.5em; margin-bottom:2em" src="https://img.shields.io/github/followers/sczhou?style=social" alt="Github Follow"></a>
|
251 |
</div>
|
252 |
|
253 |
-
<center><img src='https://visitor-badge.
|
254 |
"""
|
255 |
|
256 |
demo = gr.Interface(
|
|
|
114 |
img = cv2.imread(str(image), cv2.IMREAD_COLOR)
|
115 |
print('\timage size:', img.shape)
|
116 |
|
117 |
+
upscale = int(upscale) # convert type to int
|
118 |
+
if upscale > 4: # avoid memory exceeded due to too large upscale
|
119 |
upscale = 4
|
120 |
+
if upscale > 2 and max(img.shape[:2])>1000: # avoid memory exceeded due to too large img resolution
|
121 |
upscale = 2
|
122 |
+
if max(img.shape[:2]) > 1500: # avoid memory exceeded due to too large img resolution
|
123 |
upscale = 1
|
124 |
background_enhance = False
|
125 |
face_upsample = False
|
|
|
250 |
<a href="https://github.com/sczhou"><img style="margin-top:0.5em; margin-bottom:2em" src="https://img.shields.io/github/followers/sczhou?style=social" alt="Github Follow"></a>
|
251 |
</div>
|
252 |
|
253 |
+
<center><img src='https://visitor-badge-sczhou.glitch.me/badge?page_id=sczhou/CodeFormer' alt='visitors'></center>
|
254 |
"""
|
255 |
|
256 |
demo = gr.Interface(
|