Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
4000b35d
Commit
4000b35d
authored
Sep 06, 2014
by
Dmitriy Anisimov
Committed by
dmitriy.anisimov
Sep 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes & fixed win64 warning
parent
ad14f83b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
5 deletions
+97
-5
dataset.hpp
...s/datasetstools/include/opencv2/datasetstools/dataset.hpp
+7
-4
ar_hmdb.cpp
modules/datasetstools/samples/ar_hmdb.cpp
+1
-1
dataset.cpp
modules/datasetstools/src/dataset.cpp
+89
-0
No files found.
modules/datasetstools/include/opencv2/datasetstools/dataset.hpp
View file @
4000b35d
...
...
@@ -64,16 +64,19 @@ public:
virtual
void
load
(
const
std
::
string
&
path
)
=
0
;
std
::
vector
<
Ptr
<
Object
>
>&
getTrain
(
int
splitNum
=
0
)
{
return
train
[
splitNum
];
}
std
::
vector
<
Ptr
<
Object
>
>&
getTest
(
int
splitNum
=
0
)
{
return
test
[
splitNum
];
}
std
::
vector
<
Ptr
<
Object
>
>&
getValidation
(
int
splitNum
=
0
)
{
return
validation
[
splitNum
];
}
std
::
vector
<
Ptr
<
Object
>
>&
getTrain
(
int
splitNum
=
0
)
;
std
::
vector
<
Ptr
<
Object
>
>&
getTest
(
int
splitNum
=
0
)
;
std
::
vector
<
Ptr
<
Object
>
>&
getValidation
(
int
splitNum
=
0
)
;
int
getNumSplits
()
const
{
return
train
.
size
();
}
int
getNumSplits
()
const
;
protected
:
std
::
vector
<
std
::
vector
<
Ptr
<
Object
>
>
>
train
;
std
::
vector
<
std
::
vector
<
Ptr
<
Object
>
>
>
test
;
std
::
vector
<
std
::
vector
<
Ptr
<
Object
>
>
>
validation
;
private
:
std
::
vector
<
Ptr
<
Object
>
>
empty
;
};
}
...
...
modules/datasetstools/samples/ar_hmdb.cpp
View file @
4000b35d
...
...
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
// dataset contains for each split: a set of video file names for each action.
// For example, let output all training video file names for second split and first action.
// And its size.
AR_hmdbObj
*
example
=
static_cast
<
AR_hmdbObj
*>
(
dataset
->
getTrain
()[
0
].
get
());
AR_hmdbObj
*
example
=
static_cast
<
AR_hmdbObj
*>
(
dataset
->
getTrain
(
1
)[
0
].
get
());
printf
(
"name: %s
\n
"
,
example
->
name
.
c_str
());
vector
<
string
>
&
videoNames
=
example
->
videoNames
;
printf
(
"size: %u
\n
"
,
(
unsigned
int
)
videoNames
.
size
());
...
...
modules/datasetstools/src/dataset.cpp
0 → 100644
View file @
4000b35d
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2014, Itseez Inc, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Itseez Inc or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "opencv2/datasetstools/dataset.hpp"
#include "precomp.hpp"
namespace
cv
{
namespace
datasetstools
{
using
namespace
std
;
vector
<
Ptr
<
Object
>
>&
Dataset
::
getTrain
(
int
splitNum
)
{
if
(
splitNum
>=
(
int
)
train
.
size
())
{
return
empty
;
}
return
train
[
splitNum
];
}
vector
<
Ptr
<
Object
>
>&
Dataset
::
getTest
(
int
splitNum
)
{
if
(
splitNum
>=
(
int
)
test
.
size
())
{
return
empty
;
}
return
test
[
splitNum
];
}
vector
<
Ptr
<
Object
>
>&
Dataset
::
getValidation
(
int
splitNum
)
{
if
(
splitNum
>=
(
int
)
validation
.
size
())
{
return
empty
;
}
return
validation
[
splitNum
];
}
int
Dataset
::
getNumSplits
()
const
{
return
(
int
)
train
.
size
();
}
}
}
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