Commit 4000b35d authored by Dmitriy Anisimov's avatar Dmitriy Anisimov Committed by dmitriy.anisimov

minor changes & fixed win64 warning

parent ad14f83b
......@@ -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;
};
}
......
......@@ -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());
......
/*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();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment