diff --git a/README.md b/README.md index fad79cd95d0f60e724f9f6f6718ea5bab11b9c53..d0a559b14df4ec3906195ef46d12cffe5d033318 100644 --- a/README.md +++ b/README.md @@ -362,10 +362,13 @@ Then, we use the **TensorflowModelServe** application to produce the **predictio otbcli_TensorflowModelServe -source1.il spot7.tif -source1.placeholder x1 -source1.rfieldx 16 -source1.rfieldy 16 -model.dir /tmp/my_new_model -output.names prediction -out map.tif uint8 ``` -## Models +## Begin with provided models In the `python` folder are provided some ready-to-use deep networks, with documentation and scientific references. +See [here](doc/EXAMPLES.md) to see how to use the provided models. + Feel free to contribute with your own architecture! ## Tutorial + A tutorial is available at [MDL4EO's blog](https://mdl4eo.irstea.fr/2019/01/04/an-introduction-to-deep-learning-on-remote-sensing-images-tutorial/) diff --git a/python/README.md b/doc/EXAMPLES.md similarity index 98% rename from python/README.md rename to doc/EXAMPLES.md index d188dfd92c7e6a323171b314135d480eef9bb0c6..0c1dce39eea67a2c19c75cc8f1992d54d5b50d36 100644 --- a/python/README.md +++ b/doc/EXAMPLES.md @@ -129,11 +129,11 @@ The output class estimation is performed at pixel level. ### Generate the model ``` -python create_model_ienco-m3_patchbased.py --outdir $modeldir +python create_savedmodel_ienco-m3_patchbased.py --outdir $modeldir ``` Note that you can adjust the number of classes for the model with the `--nclasses` option. -Type `python create_model_ienco-m3_patchbased.py --help` to see the other available parameters. +Type `python create_savedmodel_ienco-m3_patchbased.py --help` to see the other available parameters. ### Train the model @@ -197,7 +197,7 @@ This fully convolutional model performs binary semantic segmentation of large sc ### Generate the model ``` -python create_model_maggiori17_fullyconv.py --outdir $modeldir +python create_savedmodel_maggiori17_fullyconv.py --outdir $modeldir ``` You can change the number of spectral bands of the input image that is processed with the model, using the `--n_channels` option. diff --git a/doc/HOWTOBUILD.md b/doc/HOWTOBUILD.md index 7e17f0a96c6fac3bde06637c70c82a5c66d4f382..ededd5e5a3f43a0d576362bc74730f2ee95cc56d 100644 --- a/doc/HOWTOBUILD.md +++ b/doc/HOWTOBUILD.md @@ -197,3 +197,37 @@ Check that the applications run properly from command line. otbcli_TensorflowModelServe --help ``` +The following output should be displayed: + +``` +Multisource deep learning classifier using TensorFlow. Change the OTB_TF_NSOURCES environment variable to set the number of sources. +Parameters: + -source1 <group> Parameters for source #1 +MISSING -source1.il <string list> Input image (or list to stack) for source #1 (mandatory) +MISSING -source1.rfieldx <int32> Input receptive field (width) for source #1 (mandatory) +MISSING -source1.rfieldy <int32> Input receptive field (height) for source #1 (mandatory) +MISSING -source1.placeholder <string> Name of the input placeholder for source #1 (mandatory) + -model <group> model parameters +MISSING -model.dir <string> TensorFlow model_save directory (mandatory) + -model.userplaceholders <string list> Additional single-valued placeholders. Supported types: int, float, bool. (optional, off by default) + -model.fullyconv <boolean> Fully convolutional (optional, off by default, default value is false) + -output <group> Output tensors parameters + -output.spcscale <float> The output spacing scale, related to the first input (mandatory, default value is 1) +MISSING -output.names <string list> Names of the output tensors (mandatory) + -output.efieldx <int32> The output expression field (width) (mandatory, default value is 1) + -output.efieldy <int32> The output expression field (height) (mandatory, default value is 1) + -optim <group> This group of parameters allows optimization of processing time + -optim.disabletiling <boolean> Disable tiling (optional, off by default, default value is false) + -optim.tilesizex <int32> Tile width used to stream the filter output (mandatory, default value is 16) + -optim.tilesizey <int32> Tile height used to stream the filter output (mandatory, default value is 16) +MISSING -out <string> [pixel] output image [pixel=uint8/uint16/int16/uint32/int32/float/double/cint16/cint32/cfloat/cdouble] (default value is float) (mandatory) + -inxml <string> Load otb application from xml file (optional, off by default) + -progress <boolean> Report progress + -help <string list> Display long help (empty list), or help for given parameters keys + +Use -help param1 [... paramN] to see detailed documentation of those parameters. + +Examples: +otbcli_TensorflowModelServe -source1.il spot6pms.tif -source1.placeholder x1 -source1.rfieldx 16 -source1.rfieldy 16 -model.dir /tmp/my_saved_model/ -model.userplaceholders is_training=false dropout=0.0 -output.names out_predict1 out_proba1 -out "classif128tgt.tif?&streaming:type=tiled&streaming:sizemode=height&streaming:sizevalue=256" +``` + diff --git a/python/create_model_ienco-m3_patchbased.py b/python/create_savedmodel_ienco-m3_patchbased.py similarity index 100% rename from python/create_model_ienco-m3_patchbased.py rename to python/create_savedmodel_ienco-m3_patchbased.py diff --git a/python/create_model_maggiori17_fullyconv.py b/python/create_savedmodel_maggiori17_fullyconv.py similarity index 100% rename from python/create_model_maggiori17_fullyconv.py rename to python/create_savedmodel_maggiori17_fullyconv.py