-
Notifications
You must be signed in to change notification settings - Fork 0
/
DatasetHelper.hpp
43 lines (32 loc) · 1.02 KB
/
DatasetHelper.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef __DATASET_HELPER_HPP__
#define __DATASET_HELPER_HPP__
#include <iostream>
#include <fstream>
#include <random>
#include <iterator>
#include <opencv2/core.hpp>
#define BOAT_TARGET 1
#define SEA_TARGET 2
#define BG_TARGET 3
#define BG_1H_ENC 0x4 // 100 in binary
#define BOATS_1H_ENC 0x2 // 010 in binary
#define SEA_1H_ENC 0x1 // 001 in binary
void saveDataset(
const std::string& name,
std::vector<std::vector<double>>& descriptors
);
void appendDescriptors(std::vector<std::vector<double>>& vect, const cv::Mat& descriptors, char oneHotEnc, bool addEnc = true);
void loadDataset(
const std::string& name,
std::vector<std::vector<double>>& inputs,
std::vector<unsigned int>& outputs,
std::vector<std::vector<double>>& vInputs,
std::vector<unsigned int>& vOutputs,
std::vector<std::vector<double>>& tInputs,
std::vector<unsigned int>& tOutputs,
unsigned int inSize,
unsigned int vSize,
unsigned int tSize,
bool includeTargets = true
);
#endif