14 #ifndef ECVL_DATASET_PARSER_H_ 15 #define ECVL_DATASET_PARSER_H_ 26 #include "yaml-cpp/yaml.h" 29 #define UNSIGNED_ENUM_CLASS(name, ...) enum class name : unsigned { __VA_ARGS__ };\ 30 inline constexpr unsigned operator+ (name const val) { return static_cast<unsigned>(val); } 89 std::string
name_ =
"DeepHealth dataset";
90 std::string
description_ =
"This is the DeepHealth example dataset!";
102 Dataset(
const filesystem::path& filename,
bool verify =
false);
111 void Dump(
const filesystem::path& file_path);
117 std::map<std::string, int> features_map_;
118 void DecodeImages(
const YAML::Node& node,
const filesystem::path& root_path,
bool verify);
119 void FindLabel(
Sample& sample,
const YAML::Node& n);
131 struct convert<
ecvl::Split>
140 static bool decode(
const YAML::Node& node,
ecvl::Split& rhs)
142 if (node[
"training"].IsDefined()) {
143 rhs.
training_ = node[
"training"].as<std::vector<int>>();
145 if (node[
"validation"].IsDefined()) {
146 rhs.
validation_ = node[
"validation"].as<std::vector<int>>();
148 if (node[
"test"].IsDefined()) {
149 rhs.
test_ = node[
"test"].as<std::vector<int>>();
157 #endif // ECVL_DATASET_PARSER_H_
std::vector< int > training_
Vector containing samples of training split.
void Dump(const filesystem::path &file_path)
Dump the Dataset into a YAML file following the DeepHealth Dataset Format.
optional< std::vector< int > > label_
Vector of sample labels.
std::vector< std::string > classes_
Vector with all the classes available in the Dataset.
std::string description_
Description of the Dataset.
ColorType
Enum class representing the ECVL supported color spaces.
std::vector< std::string > features_
Vector with all the features available in the Dataset.
std::vector< int > size_
Original x and y dimensions of the sample.
#define UNSIGNED_ENUM_CLASS(name,...)
optional< std::map< int, std::string > > values_
Map (map<feature-index,feature-value>) which stores the features of a sample.
Split split_
Splits of the Dataset. See Split.
optional< filesystem::path > label_path_
Absolute path of sample ground truth.
std::vector< filesystem::path > location_
Absolute path of the sample.
Sample image in a dataset.
std::experimental::optional< T > optional
std::string name_
Name of the Dataset.
std::vector< int > validation_
Vector containing samples of validation split.
std::vector< int > test_
Vector containing samples of test split.
static const std::regex url_regex_
SplitType
Enum class representing the Dataset supported splits.
std::vector< Sample > samples_
Vector containing all the Dataset samples. See Sample.