Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lozac'h Loic
otbtf
Commits
08727210
Commit
08727210
authored
Sep 23, 2018
by
Cresson Remi
Browse files
ENH: adjust tiling to expression field
parent
c9442e62
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/otbTensorflowModelServe.cxx
View file @
08727210
...
...
@@ -294,15 +294,28 @@ public:
if
(
GetParameterInt
(
"optim.disabletiling"
)
!=
1
)
{
// Get the tile size
SizeType
grid
Size
;
grid
Size
[
0
]
=
GetParameterInt
(
"optim.tilesizex"
);
grid
Size
[
1
]
=
GetParameterInt
(
"optim.tilesizey"
);
SizeType
tile
Size
;
tile
Size
[
0
]
=
GetParameterInt
(
"optim.tilesizex"
);
tile
Size
[
1
]
=
GetParameterInt
(
"optim.tilesizey"
);
otbAppLogINFO
(
"Force tiling with squared tiles of "
<<
gridSize
)
// Check that the tile size is aligned to the field of expression
for
(
unsigned
int
i
=
0
;
i
<
FloatVectorImageType
::
ImageDimension
;
i
++
)
if
(
tileSize
[
i
]
%
foe
[
i
]
!=
0
)
{
SizeType
::
SizeValueType
newSize
=
1
+
std
::
floor
(
tileSize
[
i
]
/
foe
[
i
]);
newSize
*=
foe
[
i
];
otbAppLogWARNING
(
"Aligning the tiling to the output expression field "
<<
"for better performances (dim "
<<
i
<<
"). New value set to "
<<
newSize
)
tileSize
[
i
]
=
newSize
;
}
otbAppLogINFO
(
"Force tiling with squared tiles of "
<<
tileSize
)
// Force the computation tile by tile
m_StreamFilter
=
StreamingFilterType
::
New
();
m_StreamFilter
->
SetOutputGridSize
(
grid
Size
);
m_StreamFilter
->
SetOutputGridSize
(
tile
Size
);
m_StreamFilter
->
SetInput
(
m_TFFilter
->
GetOutput
());
SetParameterOutputImage
(
"out"
,
m_StreamFilter
->
GetOutput
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment