Update dfc_base to respect AP script consisctency
This commit is contained in:
parent
71c8595e2a
commit
c2f6c3d53e
@ -9,26 +9,31 @@
|
|||||||
# TODO details
|
# TODO details
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
import sys
|
|
||||||
sys.path.append('..')
|
|
||||||
import ld2dap
|
import ld2dap
|
||||||
|
|
||||||
def run(rasters, treshold=1e4):
|
def run(rasters, treshold=1e4):
|
||||||
|
"""DFC base, aka no local description before learning.
|
||||||
|
|
||||||
|
Simply stack layers as description vectors.
|
||||||
|
|
||||||
|
"""
|
||||||
# Parse parameters type
|
# Parse parameters type
|
||||||
treshold = float(treshold)
|
treshold = float(treshold)
|
||||||
|
|
||||||
# Pipelines
|
# Pipelines
|
||||||
loader = ld2dap.LoadTIFF(rasters)
|
loader = ld2dap.LoadTIFF(rasters)
|
||||||
dfc_filter = ld2dap.Treshold(treshold)
|
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
|
dfc_filter.input = loader
|
||||||
out_vectors = ld2dap.RawOutput()
|
|
||||||
out_vectors.input = dfc_filter
|
|
||||||
|
|
||||||
# Compute vectors
|
# Compute vectors
|
||||||
out_vectors.run()
|
raw_out.run()
|
||||||
|
|
||||||
return out_vectors.data
|
return raw_out.data
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
return 'v0.0'
|
return 'v0.0'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user