applySuperResolutionModel | R Documentation |
Apply pretrained super-resolution network
applySuperResolutionModel(
image,
model,
targetRange,
batch_size = 32,
linmatchOrder,
mask,
verbose = FALSE
)
image |
input image |
model |
model object or filename see |
targetRange |
a vector defining min max of each the input image, eg -127.5, 127.5. Output images will be scaled back to original intensity. This range should match the mapping used in the training of the network. |
batch_size |
for prediction call |
linmatchOrder |
if not missing, then apply |
mask |
restrict intensity rescaling parameters within the mask |
verbose |
If |
Apply a patch-wise trained network to perform super-resolution. Can be applied to variable sized inputs. Warning: This function may be better used on CPU unless the GPU can accommodate the full image size. Warning 2: The global intensity range (min to max) of the output will match the input where the range is taken over all channels.
image upscaled to resolution provided by network
Avants BB
## Not run:
library(ANTsRCore)
library(keras)
orig_img = antsImageRead( getANTsRData( "r16" ) )
# input needs to be 48x48
img = resampleImage(orig_img, resampleParams = rep(256/48, 2))
model = getPretrainedNetwork( "dbpn4x" )
simg <- applySuperResolutionModel(img, model = model)
plot(orig_img)
plot(img)
plot(simg)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.