Spaces:
Runtime error
Runtime error
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> [](https://huggingface.co/spaces/sczhou/CodeFormer) [](https://replicate.com/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> [](https://huggingface.co/spaces/sczhou/CodeFormer) [](https://replicate.com/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) #
|
| 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(
|
cog.yaml β web-demos/replicate/cog.yaml
RENAMED
|
File without changes
|
predict.py β web-demos/replicate/predict.py
RENAMED
|
File without changes
|