23 this->
trainer =
new ISM::Trainer(database);
24 ISM::DataCollector::setCollect(
true);
25 this->
trainer->staticBreakRatio = 0.01;
26 this->
trainer->togetherRatio = 0.90;
27 this->
trainer->maxAngleDeviation = 45;
28 std::cout<<
"Begin with training"<<std::endl;
30 std::cout<<
"Fetching data"<<std::endl;
31 this->
data = ISM::DataCollector::getData();
32 std::cout<<
"Converting data to vector representation"<<std::endl;
38 std::vector<std::map<std::string, std::string> >
dataVector;
39 std::map<std::string, std::string> topLevelReference;
40 topLevelReference.insert(std::pair<std::string, std::string> (
"objectType",
41 data->tracksWithRef.at(0).refTrack->type));
42 topLevelReference.insert(std::pair<std::string, std::string> (
"objectId",
43 data->tracksWithRef.at(0).refTrack->observedId));
44 topLevelReference.insert(std::pair<std::string, std::string> (
"reference",
"None"));
46 std::string referencesReference =
"None";
47 for (ISM::TracksWithRef referenceIt :
data->tracksWithRef)
49 std::string reference = referenceIt.refTrack->type;
50 for (ISM::TrackPtr
object : referenceIt.tracks->tracks)
52 std::map<std::string, std::string> dataMap;
53 std::string objectType =
object->type;
54 std::string objectId =
object->observedId;
55 dataMap.insert(std::pair<std::string, std::string> (
"reference", reference));
56 dataMap.insert(std::pair<std::string, std::string> (
"objectType", objectType));
57 dataMap.insert(std::pair<std::string, std::string> (
"objectId", objectId));
58 dataVector.push_back(dataMap);
67 for (ISM::TracksWithRef referenceIt :
data->tracksWithRef )
69 std::cout<<
"Reference is: "<<referenceIt.refTrack->type<<std::endl;
70 for (ISM::TrackPtr track : referenceIt.tracks->tracks)
72 std::cout<<
"Object's type is: "<<track->type<<
" Observed Id is: "<<track->observedId<<std::endl;
79 for (std::map<std::string, std::string> refIt :
dataVector)
81 std::cout<<
"Reference is: "<<refIt.find(
"reference")->second<<std::endl;
82 std::cout<<
"Object's type is: "<<refIt.find(
"objectType")->second<<
" Observed Id is: " 83 <<refIt.find(
"objectId")->second<<std::endl;
ISM::CollectedDataPtr data
std::vector< std::map< std::string, std::string > > dataVector
ISM::CollectedDataPtr getDataCollector()
std::vector< std::map< std::string, std::string > > getDataVector()
Scene_model(std::string database)
std::vector< std::map< std::string, std::string > > dataToVector()