From c2f6c3d53ed379e3aaa0bf65b06276fa4b143f59 Mon Sep 17 00:00:00 2001 From: Karamaz0V1 Date: Fri, 21 Sep 2018 16:01:40 +0200 Subject: [PATCH] Update dfc_base to respect AP script consisctency --- descriptors/dfc_base.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/descriptors/dfc_base.py b/descriptors/dfc_base.py index dede241..da83012 100644 --- a/descriptors/dfc_base.py +++ b/descriptors/dfc_base.py @@ -9,26 +9,31 @@ # TODO details import numpy as np - -import sys -sys.path.append('..') import ld2dap def run(rasters, treshold=1e4): + """DFC base, aka no local description before learning. + + Simply stack layers as description vectors. + + """ # Parse parameters type treshold = float(treshold) # Pipelines loader = ld2dap.LoadTIFF(rasters) dfc_filter = ld2dap.Treshold(treshold) + normalize = ld2dap.Normalize(dtype=np.uint8) + raw_out = ld2dap.RawOutput() + + raw_out.input = normalize + normalize.input = dfc_filter dfc_filter.input = loader - out_vectors = ld2dap.RawOutput() - out_vectors.input = dfc_filter # Compute vectors - out_vectors.run() + raw_out.run() - return out_vectors.data + return raw_out.data def version(): return 'v0.0'