deepnets
This module provides tools to easily interact with deep learning models.
OTBTF is needed to use this module.
Super-resolution¶
The SR4RS model can be applied over any scenes.core.Source instance.
We recall that this model is intended to be used over Sentinel-2 optical
images. For example, here is how we perform the super-resolution of a Theia S2
product:
import scenes
archive = "SENTINEL2B_..._T31TEJ_D_V1-8.zip"
s2_scene = scenes.sentinel.Sentinel22AScene(archive)
s2_image = s2_scene.get_10m_bands()
sr = scenes.deepnets.sr4rs(s2_image) # pyotb.core.OTBObject
sr.write("sr.tif")
inference(dic)
¶
Generic function to perform deep nets inference.
When OTBTF is not found, a warning message is printed. Args: dic: otb parameters dict
Returns:
| Type | Description |
|---|---|
|
pyotb App instance. When OTBTF is not found, None is returned. |
Source code in scenes/deepnets.py
sr4rs(input_image, model_url=SR4RS_MODEL_URL, tmp_dir='/tmp')
¶
Applies the SR4RS model for super-resolution
See https://github.com/remicres/sr4rs for implementation details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_image |
Union[str, OTBObject]
|
pyotb Input |
required |
model_url |
str
|
SR4RS pre-trained model URL. Must point to a online .zip file. |
SR4RS_MODEL_URL
|
tmp_dir |
str
|
directory for temporary files. |
'/tmp'
|
Returns:
| Type | Description |
|---|---|
App
|
pyotb Output |