-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathio_func.h
32 lines (22 loc) · 873 Bytes
/
io_func.h
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
#ifndef PREPROCESSING_H
#define PREPROCESSING_H
#include <dlib/clustering.h>
#include <iostream>
#include <string>
#include <vector>
const int DIMENTIONS = 7;
const char DELIMITER = ';';
typedef dlib::matrix<float, DIMENTIONS, 1> feature_point;
typedef dlib::radial_basis_kernel<feature_point> kernel_type;
feature_point parse_line(const std::string& line);
void print_formatted(std::ostream& stream, const feature_point& point);
void serialize_model(
const std::string& filename,
const dlib::kkmeans<kernel_type>& kmeans_model,
const dlib::vector_normalizer<feature_point>& normalizer,
const std::vector<feature_point>& dataset);
void deserialize_model(const std::string& filename,
dlib::kkmeans<kernel_type>& kmeans_model,
dlib::vector_normalizer<feature_point>& normalizer,
std::vector<std::vector<feature_point>>& clusters);
#endif