Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
ede33148
Commit
ede33148
authored
Sep 25, 2018
by
Guillaume Pasero
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'detect-empty-samples' into 'develop'
BUG:
#1582
: detect empty training data See merge request
!232
parents
b3cb60bd
9566e26b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx
...tions/AppClassification/app/otbMultiImageSamplingRate.cxx
+10
-1
No files found.
Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx
View file @
ede33148
...
...
@@ -334,12 +334,17 @@ private:
std
::
string
outputBase
=
outputPath
.
substr
(
0
,
outputPath
.
find_last_of
(
'.'
));
std
::
string
outputExt
=
outputPath
.
substr
(
outputPath
.
find_last_of
(
'.'
),
std
::
string
::
npos
);
unsigned
int
overflowCount
=
0
;
bool
noSamples
=
true
;
for
(
unsigned
int
i
=
0
;
i
<
nbInputs
;
i
++
)
{
// Print results
oss
.
str
(
std
::
string
(
""
));
oss
<<
" className requiredSamples totalSamples rate
"
<<
std
::
endl
;
oss
<<
" className requiredSamples totalSamples rate
\n
"
;
MapRateType
rates
=
m_CalculatorList
->
GetRatesByClass
(
i
);
if
(
!
rates
.
empty
())
{
noSamples
=
false
;
}
MapRateType
::
const_iterator
itRates
=
rates
.
begin
();
for
(;
itRates
!=
rates
.
end
();
++
itRates
)
{
...
...
@@ -358,6 +363,10 @@ private:
oss
<<
outputBase
<<
"_"
<<
i
+
1
<<
outputExt
;
m_CalculatorList
->
GetNthElement
(
i
)
->
Write
(
oss
.
str
());
}
if
(
noSamples
)
{
otbAppLogFATAL
(
"No samples found in the inputs!"
);
}
if
(
overflowCount
)
{
std
::
string
plural
(
overflowCount
>
1
?
"s"
:
""
);
...
...
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