sczhou commited on
Commit
1d7f0a3
Β·
1 Parent(s): 2433e18

update visitor badge.

Browse files
README.md CHANGED
@@ -7,9 +7,8 @@
7
  [Paper](https://arxiv.org/abs/2206.11253) | [Project Page](https://shangchenzhou.com/projects/CodeFormer/) | [Video](https://youtu.be/d3VDpkXlueI)
8
 
9
 
10
- <a href="https://colab.research.google.com/drive/1m52PNveE4PBhYrecj34cnpEeiHcC5LTb?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a> [![Hugging Face](https://img.shields.io/badge/Demo-%F0%9F%A4%97%20Hugging%20Face-blue)](https://huggingface.co/spaces/sczhou/CodeFormer) [![Replicate](https://img.shields.io/badge/Demo-%F0%9F%9A%80%20Replicate-blue)](https://replicate.com/sczhou/codeformer) ![visitors](https://visitor-badge.laobi.icu/badge?page_id=sczhou/CodeFormer)
11
 
12
- <!-- ![visitors](https://visitor-badge.glitch.me/badge?page_id=sczhou/CodeFormer) -->
13
 
14
 
15
  [Shangchen Zhou](https://shangchenzhou.com/), [Kelvin C.K. Chan](https://ckkelvinchan.github.io/), [Chongyi Li](https://li-chongyi.github.io/), [Chen Change Loy](https://www.mmlab-ntu.com/person/ccloy/)
 
7
  [Paper](https://arxiv.org/abs/2206.11253) | [Project Page](https://shangchenzhou.com/projects/CodeFormer/) | [Video](https://youtu.be/d3VDpkXlueI)
8
 
9
 
10
+ <a href="https://colab.research.google.com/drive/1m52PNveE4PBhYrecj34cnpEeiHcC5LTb?usp=sharing"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="google colab logo"></a> [![Hugging Face](https://img.shields.io/badge/Demo-%F0%9F%A4%97%20Hugging%20Face-blue)](https://huggingface.co/spaces/sczhou/CodeFormer) [![Replicate](https://img.shields.io/badge/Demo-%F0%9F%9A%80%20Replicate-blue)](https://replicate.com/sczhou/codeformer) ![visitors](https://visitor-badge-sczhou.glitch.me/badge?page_id=sczhou/CodeFormer)
11
 
 
12
 
13
 
14
  [Shangchen Zhou](https://shangchenzhou.com/), [Kelvin C.K. Chan](https://ckkelvinchan.github.io/), [Chongyi Li](https://li-chongyi.github.io/), [Chen Change Loy](https://www.mmlab-ntu.com/person/ccloy/)
app.py β†’ web-demos/hugging_face/app.py RENAMED
@@ -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(
cog.yaml β†’ web-demos/replicate/cog.yaml RENAMED
File without changes
predict.py β†’ web-demos/replicate/predict.py RENAMED
File without changes