Skip to content
Snippets Groups Projects
Commit 2c3257fe authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Add Database abstract class

parent efb97bd2
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,9 @@
#include "aidge/backend/TensorImpl.hpp"
#include "aidge/data/Data.hpp"
#include "aidge/data/Tensor.hpp"
#include "aidge/data/Database.hpp"
#include "aidge/data/DatabaseTensor.hpp"
#include "aidge/data/Dataloader.hpp"
#include "aidge/graph/Connector.hpp"
#include "aidge/graph/GraphView.hpp"
#include "aidge/graph/Node.hpp"
......
#ifndef Database_H_
#define Database_H_
#include <cstring>
#include "aidge/data/Tensor.hpp"
namespace Aidge{
/**
* @brief Database. An abstract class representing a database. All databases should inherit from this class. All subclasses should overwrite ```get_item()``` to fetch data from a given index.
* @todo Make the dataset generic. Currently supprting only tensor. Always ground truth.
*/
class Database {
public:
virtual ~Database() = default;
/**
* @brief Fetch a data sample and its corresponding ground_truth
* @param index index of the pair (```data```, ```ground truth```) to fetch from the database
* @return A pair of pointers to the data (first) and its corresping ground truth (second)
*/
virtual std::pair<std::shared_ptr<Tensor>,std::shared_ptr<Tensor>> get_item(unsigned int index) = 0;
/**
* @return The number of data samples in the database.
*/
virtual unsigned int get_len() = 0;
// void load(const std::string& /*dataPath*/, const std::string& labelPath = "");
protected:
std::vector<std::shared_ptr<Tensor>> mData;
std::vector<std::shared_ptr<Tensor>> mLabel;
};
}
#endif /* Database_H_ */
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment