Spaces:
Sleeping
Sleeping
add upscale limit for large input.
Browse files3 unmodified lines4567789103 unmodified linescolorFrom: bluecolorTo: greensdk: gradiosdk_version: 3.3sdk_version: 3.4app_file: app.pypinned: falselicense: apache-2.0110 unmodified lines1111121131141151161171181191201211221231247 unmodified lines132133134130131132135136137110 unmodified lines detection_model = "retinaface_resnet50" print('Inp:', image, background_enhance, face_upsample, upscale, codeformer_fidelity)
img = cv2.imread(str(image), cv2.IMREAD_COLOR) print('\timage size:', img.shape)
upscale = int(upscale) # covert type to int if upscale > 4: upscale = 4 # avoid momory exceeded due to too large upscale if upscale > 2 and min(img.shape[:2])>1280: upscale = 2 # avoid momory exceeded due to too large img resolution
face_helper = FaceRestoreHelper( upscale,7 unmodified lines bg_upsampler = upsampler if background_enhance else None face_upsampler = upsampler if face_upsample else None
img = cv2.imread(str(image), cv2.IMREAD_COLOR)
print('\timage size:', img.shape)
if has_aligned: # the input faces are already cropped and alignedREADME.md+1-1
app.py+5-3