sczhou commited on
Commit
14ebd0d
1 Parent(s): 3f8f5b4

update visitor badge.

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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) # covert type to int
118
- if upscale > 4: # avoid momory exceeded due to too large upscale
119
  upscale = 4
120
- if upscale > 2 and max(img.shape[:2])>1000: # avoid momory exceeded due to too large img resolution
121
  upscale = 2
122
- if max(img.shape[:2]) > 1500: # avoid momory exceeded due to too large img resolution
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.laobi.icu/badge?page_id=sczhou/CodeFormer' alt='visitors'></center>
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(