Spaces:
Running
Running
add upscale limit for large input.
Browse files3 unmodified lines456789103 unmodified linescolorFrom: bluecolorTo: greensdk: gradiosdk_version: 3.3app_file: app.pypinned: falselicense: apache-2.03 unmodified lines456789103 unmodified linescolorFrom: bluecolorTo: greensdk: gradiosdk_version: 3.4app_file: app.pypinned: falselicense: apache-2.0
110 unmodified lines1111121131141151161171181197 unmodified lines127128129130131132133134135110 unmodified linesdetection_model = "retinaface_resnet50"print('Inp:', image, background_enhance, face_upsample, upscale, codeformer_fidelity)upscale = int(upscale) # covert type to intif upscale > 4:upscale = 4 # avoid momory exceeded due to too large upscaleface_helper = FaceRestoreHelper(upscale,7 unmodified linesbg_upsampler = upsampler if background_enhance else Noneface_upsampler = upsampler if face_upsample else Noneimg = cv2.imread(str(image), cv2.IMREAD_COLOR)print('\timage size:', img.shape)if has_aligned:# the input faces are already cropped and aligned110 unmodified lines1111121131141151161171181191201211221231247 unmodified lines132133134135136137110 unmodified linesdetection_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 intif upscale > 4:upscale = 4 # avoid momory exceeded due to too large upscaleif upscale > 2 and min(img.shape[:2])>1280:upscale = 2 # avoid momory exceeded due to too large img resolutionface_helper = FaceRestoreHelper(upscale,7 unmodified linesbg_upsampler = upsampler if background_enhance else Noneface_upsampler = upsampler if face_upsample else Noneif has_aligned:# the input faces are already cropped and aligned
README.md+1-1
app.py+5-3