SOMHunter Core
extractor.h
Go to the documentation of this file.
1 /* This file is part of SOMHunter.
2  *
3  * Copyright (C) 2021 Frantisek Mejzlik <frankmejzlik@protonmail.com>
4  * Mirek Kratochvil <exa.exa@gmail.com>
5  * Patrik Vesely <prtrikvesely@gmail.com>
6  * Marek Dobransky <marekdobr@gmail.com>
7  *
8  * SOMHunter is free software: you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License as published by the Free
10  * Software Foundation, either version 2 of the License, or (at your option)
11  * any later version.
12  *
13  * SOMHunter is distributed in the hope that it will be useful, but WITHOUT ANY
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU General Public License along with
19  * SOMHunter. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef EXTRACTOR_H_
23 #define EXTRACTOR_H_
24 
25 #include "log.h"
26 
27 #include <torch/jit.h>
28 #include <torch/types.h>
29 
30 namespace sh {
31 class Extractor {
32 public:
33  Extractor();
34 
35  void run();
36 
37 private:
38  torch::jit::script::Module resnet152;
39  torch::jit::script::Module resnext101;
40 
41  at::Tensor bias;
42  at::Tensor weights;
43 
44  at::Tensor kw_pca_mat;
45  at::Tensor kw_pca_mean_vec;
46 
47  std::string out_dir{ "output/" };
48  std::string thumbs{ "data/ITEC_w2vv/thumbs/" };
49  std::string frames{ "data/ITEC_w2vv/ITEC.keyframes.dataset" };
50 };
51 
52 }; // namespace sh
53 #endif // EXTRACTOR_H_
Definition: extractor.h:31
std::string thumbs
Definition: extractor.h:48
at::Tensor kw_pca_mat
Definition: extractor.h:44
torch::jit::script::Module resnext101
Definition: extractor.h:39
at::Tensor weights
Definition: extractor.h:42
Extractor()
Definition: extractor.cpp:164
torch::jit::script::Module resnet152
Definition: extractor.h:38
void run()
Definition: extractor.cpp:190
std::string frames
Definition: extractor.h:49
at::Tensor bias
Definition: extractor.h:41
at::Tensor kw_pca_mean_vec
Definition: extractor.h:45
std::string out_dir
Definition: extractor.h:47
Definition: common-types.h:33