otbtf issueshttps://gitlab.irstea.fr/remi.cresson/otbtf/-/issues2022-06-10T10:38:22+02:00https://gitlab.irstea.fr/remi.cresson/otbtf/-/issues/27Notes on how create quantized models2022-06-10T10:38:22+02:00Cresson RemiNotes on how create quantized modelsfrom `test_graph_transform` branch
```
python /opt/otbtf/lib/python3.8/site-packages/tensorflow/python/tools/freeze_graph.py --input_saved_model_dir sr4rs_sentinel2_bands4328_france2020_savedmodel --output_node_names "output_64" --outp...from `test_graph_transform` branch
```
python /opt/otbtf/lib/python3.8/site-packages/tensorflow/python/tools/freeze_graph.py --input_saved_model_dir sr4rs_sentinel2_bands4328_france2020_savedmodel --output_node_names "output_64" --output_graph sr4rs_graphdef.pb
/opt/otbtf/bin/graph_transforms/transform_graph --in_graph=sr4rs_graphdef.pb --out_graph=sr4rs_opt.pb --inputs="lr_input" --outputs="output_64" --transforms='add_default_attributes remove_nodes(op=CheckNumerics) fold_constants(ignore_errors=true) fold_batch_norms fold_old_batch_norms quantize_nodes(input_min=-1,input_max=1) strip_unused_nodes sort_by_execution_order'
rm -rf new_sm
python gd2sm.py
python sr4rs/code/sr.py --input image.tif --savedmodel new_sm/ --output hr.tif
```
With file `gd2sm.py`:
```python
import tensorflow as tf
from tensorflow.python.saved_model import signature_constants
from tensorflow.python.saved_model import tag_constants
version_str = tf.__version__
if int(version_str.split('.')[0]) == 2:
# tensorflow 2.x
del tf
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
# else tensorflow 1.x
export_dir = 'new_sm'
graph_pb = 'sr4rs_opt.pb'
builder = tf.saved_model.builder.SavedModelBuilder(export_dir)
with tf.gfile.GFile(graph_pb, "rb") as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
sigs = {}
with tf.Session(graph=tf.Graph()) as sess:
tf.import_graph_def(graph_def, name="")
g = tf.get_default_graph()
values = g.get_tensor_by_name("lr_input:0")
predictions = g.get_tensor_by_name("output_64:0")
sigs[signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY] = \
tf.saved_model.signature_def_utils.predict_signature_def(
{"lr_input": values}, {"output_64": predictions})
builder.add_meta_graph_and_variables(sess, [tag_constants.SERVING], signature_def_map=sigs)
builder.save()
```Cresson RemiCresson Remihttps://gitlab.irstea.fr/remi.cresson/otbtf/-/issues/32Keep metadata in PatchesExtraction2022-09-12T09:41:47+02:00Cresson RemiKeep metadata in PatchesExtractionWe have to keep the input images metadatas in the output patches images.We have to keep the input images metadatas in the output patches images.https://gitlab.irstea.fr/remi.cresson/otbtf/-/issues/41Improve documentation2023-04-24T16:15:07+02:00Cresson RemiImprove documentation- [ ] pip install otbtf (standalone)- [ ] pip install otbtf (standalone)https://gitlab.irstea.fr/remi.cresson/otbtf/-/issues/42TensorRT support2023-05-19T09:22:27+02:00Cresson RemiTensorRT support# Notes
à ajouter au docker file pour compiler avec le support de TensorRT
```
RUN TRTDIR=/opt/otbtf/local/lib/python3.10/dist-packages/tensorflow/include/third_party/tensorrt/ && \
mkdir $TRTDIR && \
ln -s $(find /usr/ -iname "...# Notes
à ajouter au docker file pour compiler avec le support de TensorRT
```
RUN TRTDIR=/opt/otbtf/local/lib/python3.10/dist-packages/tensorflow/include/third_party/tensorrt/ && \
mkdir $TRTDIR && \
ln -s $(find /usr/ -iname "nvinfer.h") $TRTDIR
```https://gitlab.irstea.fr/remi.cresson/otbtf/-/issues/43Ultra-lightweight OTBTF image with otbapps only2023-06-09T17:25:10+02:00Cresson RemiUltra-lightweight OTBTF image with otbapps onlyCould be great to have an ultralight image optimized for inference jobs in production environments.
- only OTB+TF binaries
- no TF python package, and none of its dependency
- in short, keep only libtensorflow*.so and throw everything e...Could be great to have an ultralight image optimized for inference jobs in production environments.
- only OTB+TF binaries
- no TF python package, and none of its dependency
- in short, keep only libtensorflow*.so and throw everything else. Keep the OTB stuff.https://gitlab.irstea.fr/remi.cresson/otbtf/-/issues/49Improve GDAL formats support2024-01-09T16:26:40+01:00Cresson RemiImprove GDAL formats support- zarr blosc compression
- geoparquet apache arrow
- libwebp- zarr blosc compression
- geoparquet apache arrow
- libwebp