Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cszn/BSRGAN
/ functions
Functions
109 in github.com/cszn/BSRGAN
⨍
Functions
109
◇
Types & classes
5
↓ 5 callers
Function
download_pretrained_model
(model_dir='model_zoo', model_name='dncnn3.pth')
main_download_pretrained_models.py:21
↓ 4 callers
Function
add_JPEG_noise
(img)
utils/utils_blindsr.py:412
↓ 4 callers
Function
add_blur
(img, sf=4)
utils/utils_blindsr.py:335
↓ 4 callers
Function
calculate_weights_indices
(in_length, out_length, scale, kernel, kernel_width, antialiasing)
utils/utils_image.py:709
↓ 3 callers
Function
add_Gaussian_noise
(img, noise_level1=2, noise_level2=25)
utils/utils_blindsr.py:363
↓ 3 callers
Method
forward
(self, x)
utils/utils_model.py:310
↓ 3 callers
Function
ssim
(img1, img2)
utils/utils_image.py:670
↓ 2 callers
Method
__init__
(self, nf, gc=32)
models/network_rrdbnet.py:61
↓ 2 callers
Function
add_Poisson_noise
(img)
utils/utils_blindsr.py:398
↓ 2 callers
Function
add_resize
(img, sf=4)
utils/utils_blindsr.py:349
↓ 2 callers
Function
add_speckle_noise
(img, noise_level1=2, noise_level2=25)
utils/utils_blindsr.py:380
↓ 2 callers
Function
bicubic_degradation
Args: x: HxWxC image, [0, 1] sf: down-scale factor Return: bicubicly downsampled LR image
utils/utils_blindsr.py:228
↓ 2 callers
Function
cubic
(x)
utils/utils_image.py:701
↓ 2 callers
Function
describe_model
(model)
utils/utils_model.py:278
↓ 2 callers
Function
describe_params
(model)
utils/utils_model.py:291
↓ 2 callers
Function
fspecial
python code from: https://github.com/ronaldosena/imagens-medicas-2/blob/40171a6c259edec7827a6693a93955de2bd39e76/Aulas/aula_2_-_uniform_fil
utils/utils_blindsr.py:211
↓ 2 callers
Function
mkdir
(path)
utils/utils_image.py:154
↓ 2 callers
Function
random_crop
(lq, hq, sf=4, lq_patchsize=64)
utils/utils_blindsr.py:421
↓ 2 callers
Function
sizeof_fmt
Get human readable file size. Args: size (int): File size. suffix (str): Suffix. Default: 'B'. Return: str: Forma
utils/utils_googledownload.py:12
↓ 2 callers
Function
test_pad
(model, L, modulo=16, sf=1)
utils/utils_model.py:108
↓ 2 callers
Function
test_split_fn
Args: model: trained model L: input Low-quality image refield: effective receptive filed of the network, 32 is enough
utils/utils_model.py:125
↓ 2 callers
Method
write
(self, message)
utils/utils_logger.py:61
↓ 1 callers
Function
_augment
(img)
utils/utils_image.py:476
↓ 1 callers
Function
_get_paths_from_images
(path)
utils/utils_image.py:74
↓ 1 callers
Function
add_sharpening
USM sharpening. borrowed from real-ESRGAN Input image: I; Blurry image: B. 1. K = I + weight * (I - B) 2. Mask = 1 if abs(I - B) > thre
utils/utils_blindsr.py:309
↓ 1 callers
Function
anisotropic_Gaussian
generate an anisotropic Gaussian kernel Args: ksize : e.g., 15, kernel size theta : [0, pi], rotation angle range l1
utils/utils_blindsr.py:64
↓ 1 callers
Function
augment_img
Kai Zhang (github: https://github.com/cszn)
utils/utils_image.py:381
↓ 1 callers
Function
bgr2ycbcr
bgr version of rgb2ycbcr only_y: only return Y channel Input: uint8, [0, 255] float, [0, 1]
utils/utils_image.py:574
↓ 1 callers
Function
degradation_bsrgan
This is the degradation model of BSRGAN from the paper "Designing a Practical Degradation Model for Deep Blind Image Super-Resolution"
utils/utils_blindsr.py:432
↓ 1 callers
Function
download_file_from_google_drive
Download files from google drive. Ref: https://stackoverflow.com/questions/25010369/wget-curl-large-file-from-google-drive # noqa E501
utils/utils_googledownload.py:27
↓ 1 callers
Function
fspecial_gaussian
(hsize, sigma)
utils/utils_blindsr.py:188
↓ 1 callers
Function
fspecial_laplacian
(alpha)
utils/utils_blindsr.py:202
↓ 1 callers
Function
get_confirm_token
(response)
utils/utils_googledownload.py:58
↓ 1 callers
Function
get_image_paths
(dataroot)
utils/utils_image.py:67
↓ 1 callers
Function
get_timestamp
()
utils/utils_image.py:33
↓ 1 callers
Function
gm_blur_kernel
(mean, cov, size=15)
utils/utils_blindsr.py:86
↓ 1 callers
Function
imread_uint
(path, n_channels=3)
utils/utils_image.py:186
↓ 1 callers
Function
imssave
imgs: list, N images of size WxHxC
utils/utils_image.py:112
↓ 1 callers
Function
initialize_weights
(net_l, scale=1)
models/network_rrdbnet.py:8
↓ 1 callers
Function
is_image_file
(filename)
utils/utils_image.py:29
↓ 1 callers
Function
main
()
main_test_bsrgan.py:35
↓ 1 callers
Function
make_layer
(block, n_layers)
models/network_rrdbnet.py:28
↓ 1 callers
Function
patches_from_image
(img, p_size=512, p_overlap=64, p_max=800)
utils/utils_image.py:93
↓ 1 callers
Function
print_model
(model)
utils/utils_model.py:232
↓ 1 callers
Function
print_params
(model)
utils/utils_model.py:240
↓ 1 callers
Function
save_response_content
(response, destination, file_size=None,
utils/utils_googledownload.py:65
↓ 1 callers
Function
shift_pixel
shift pixel for super-resolution with different scale factors Args: x: WxHxC or WxH sf: scale factor upper_left: shift
utils/utils_blindsr.py:99
↓ 1 callers
Function
test
(model, L)
utils/utils_model.py:96
↓ 1 callers
Function
test_mode
# --------------------------------------- # Kai Zhang (github: https://github.com/cszn) # 03/Mar/2019 # -------------------------
utils/utils_model.py:49
↓ 1 callers
Function
test_split
(model, L, refield=32, min_size=256, sf=1, modulo=1)
utils/utils_model.py:172
↓ 1 callers
Function
test_split_x8
(model, L, refield=32, min_size=256, sf=1, modulo=1)
utils/utils_model.py:203
↓ 1 callers
Function
test_x8
(model, L, modulo=1, sf=1)
utils/utils_model.py:184
Method
__init__
(self, log_path="default.log")
utils/utils_logger.py:57
Method
__init__
(self, in_channels=3, out_channels=3)
utils/utils_model.py:306
Method
__init__
(self, nf=64, gc=32, bias=True)
models/network_rrdbnet.py:36
Method
__init__
(self, in_nc=3, out_nc=3, nf=64, nb=23, gc=32, sf=4)
models/network_rrdbnet.py:75
Function
analytic_kernel
Calculate the X4 kernel from the X2 kernel (for proof see appendix in paper)
utils/utils_blindsr.py:48
Function
augment_img_np3
(img, mode=0)
utils/utils_image.py:442
Function
augment_img_tensor
Kai Zhang (github: https://github.com/cszn)
utils/utils_image.py:423
Function
augment_img_tensor4
Kai Zhang (github: https://github.com/cszn)
utils/utils_image.py:402
Function
augment_imgs
(img_list, hflip=True, rot=True)
utils/utils_image.py:470
Function
blur
x: image, NxcxHxW k: kernel, Nx1xhxw
utils/utils_blindsr.py:128
Function
calculate_psnr
(img1, img2, border=0)
utils/utils_image.py:622
Function
calculate_ssim
calculate SSIM the same outputs as MATLAB's img1, img2: [0, 255]
utils/utils_image.py:643
Function
channel_convert
(in_c, tar_type, img_list)
utils/utils_image.py:598
Function
classical_degradation
blur + downsampling Args: x: HxWxC image, [0, 1]/[0, 255] k: hxw, double sf: down-scale factor Return:
utils/utils_blindsr.py:292
Function
degradation_bsrgan_plus
This is an extended degradation model by combining the degradation models of BSRGAN and Real-ESRGAN ---------- img: HXWXC, [0, 1]
utils/utils_blindsr.py:524
Function
dpsr_degradation
bicubic downsampling + blur Args: x: HxWxC image, [0, 1] k: hxw, double sf: down-scale factor Return:
utils/utils_blindsr.py:266
Function
find_last_checkpoint
# --------------------------------------- # Kai Zhang (github: https://github.com/cszn) # 03/Mar/2019 # -------------------------
utils/utils_model.py:20
Method
flush
(self)
utils/utils_logger.py:65
Method
forward
(self, x)
models/network_rrdbnet.py:49
Method
forward
(self, x)
models/network_rrdbnet.py:67
Method
forward
(self, x)
models/network_rrdbnet.py:93
Function
gen_kernel
# modified version of https://github.com/assafshocher/BlindSR_dataset_generator # Kai Zhang # min_var = 0.175 * sf # variance of the
utils/utils_blindsr.py:146
Function
imresize
(img, scale, antialiasing=True)
utils/utils_image.py:767
Function
imresize_np
(img, scale, antialiasing=True)
utils/utils_image.py:840
Function
imsave
(img, img_path)
utils/utils_image.py:204
Function
imshow
(x, title=None, cbar=False, figsize=None)
utils/utils_image.py:37
Function
imwrite
(img, img_path)
utils/utils_image.py:210
Function
info_model
(model)
utils/utils_model.py:255
Function
info_params
(model)
utils/utils_model.py:263
Function
log
(*args, **kwargs)
utils/utils_logger.py:16
Function
logger_info
set up logger modified by Kai Zhang (github: https://github.com/cszn)
utils/utils_logger.py:27
Function
mkdir_and_rename
(path)
utils/utils_image.py:167
Function
mkdirs
(paths)
utils/utils_image.py:159
Function
modcrop
(img_in, scale)
utils/utils_image.py:495
Function
modcrop_np
Args: img: numpy image, WxH or WxHxC sf: scale factor Return: cropped image
utils/utils_blindsr.py:29
Function
read_img
(path)
utils/utils_image.py:221
Function
rgb2ycbcr
same as matlab rgb2ycbcr only_y: only return Y channel Input: uint8, [0, 255] float, [0, 1]
utils/utils_image.py:530
Function
shave
(img_in, border=0)
utils/utils_image.py:511
Function
single2tensor3
(img)
utils/utils_image.py:303
Function
single2tensor4
(img)
utils/utils_image.py:308
Function
single2tensor5
(img)
utils/utils_image.py:330
Function
single2uint
(img)
utils/utils_image.py:255
Function
single2uint16
(img)
utils/utils_image.py:265
Function
single32tensor5
(img)
utils/utils_image.py:334
Function
single42tensor4
(img)
utils/utils_image.py:338
Function
split_imageset
split the large images from original_dataroot into small overlapped images with size (p_size)x(p_size), and save them into taget_dataroot; o
utils/utils_image.py:125
Function
srmd_degradation
blur + bicubic downsampling Args: x: HxWxC image, [0, 1] k: hxw, double sf: down-scale factor Return:
utils/utils_blindsr.py:241
Function
surf
(Z, cmap='rainbow', figsize=None)
utils/utils_image.py:47
next →
1–100 of 109, ranked by callers