SOMHunter Core
sh::CanvasQueryRanker Class Reference

#include <canvas-query-ranker.h>

Collaboration diagram for sh::CanvasQueryRanker:

Public Member Functions

 CanvasQueryRanker (const Settings &_settings, KeywordRanker *p_core)
 
void score (const CanvasQuery &, ScoreModel &model, size_t temporal, UsedTools &used_tools, const PrimaryFrameFeatures &_dataset_features, const DatasetFrames &_dataset_frames)
 

Static Public Attributes

static const size_t models_input_width { 224 }
 
static const size_t models_input_height { 224 }
 
static const size_t models_num_channels { 3 }
 

Private Member Functions

at::Tensor get_features (const CanvasQuery &, UsedTools &used_tools)
 
at::Tensor get_L2norm (const at::Tensor &_data) const
 
std::vector< std::size_t > get_RoIs (const CanvasQuery &collage) const
 
std::size_t get_RoI (const CanvasSubquery &image) const
 
std::vector< float > score_image (const std::vector< float > &feature, std::size_t region) const
 
std::vector< float > average_scores (const std::vector< std::vector< float >> &scores) const
 

Private Attributes

KeywordRanker_p_core
 
bool _loaded
 
torch::jit::script::Module resnet152
 
torch::jit::script::Module resnext101
 
torch::Tensor bias
 
torch::Tensor weights
 
torch::Tensor kw_pca_mat
 
torch::Tensor kw_pca_mean_vec
 
const std::vector< std::vector< float > > RoIs
 
std::vector< FeatureMatrixregion_data
 

Constructor & Destructor Documentation

◆ CanvasQueryRanker()

CanvasQueryRanker::CanvasQueryRanker ( const Settings _settings,
KeywordRanker p_core 
)
Here is the call graph for this function:

Member Function Documentation

◆ average_scores()

std::vector< float > CanvasQueryRanker::average_scores ( const std::vector< std::vector< float >> &  scores) const
private

◆ get_features()

at::Tensor CanvasQueryRanker::get_features ( const CanvasQuery collage,
UsedTools used_tools 
)
private
Here is the call graph for this function:

◆ get_L2norm()

at::Tensor CanvasQueryRanker::get_L2norm ( const at::Tensor &  _data) const
private

◆ get_RoI()

std::size_t CanvasQueryRanker::get_RoI ( const CanvasSubquery image) const
private

◆ get_RoIs()

std::vector< std::size_t > CanvasQueryRanker::get_RoIs ( const CanvasQuery collage) const
private
Here is the call graph for this function:

◆ score()

void CanvasQueryRanker::score ( const CanvasQuery canvas_query,
ScoreModel model,
size_t  temporal,
UsedTools used_tools,
const PrimaryFrameFeatures _dataset_features,
const DatasetFrames _dataset_frames 
)
Here is the call graph for this function:

◆ score_image()

std::vector< float > CanvasQueryRanker::score_image ( const std::vector< float > &  feature,
std::size_t  region 
) const
private
Here is the call graph for this function:

Member Data Documentation

◆ _loaded

bool sh::CanvasQueryRanker::_loaded
private

◆ _p_core

KeywordRanker* sh::CanvasQueryRanker::_p_core
private

◆ bias

torch::Tensor sh::CanvasQueryRanker::bias
private

◆ kw_pca_mat

torch::Tensor sh::CanvasQueryRanker::kw_pca_mat
private

◆ kw_pca_mean_vec

torch::Tensor sh::CanvasQueryRanker::kw_pca_mean_vec
private

◆ models_input_height

const size_t sh::CanvasQueryRanker::models_input_height { 224 }
static

◆ models_input_width

const size_t sh::CanvasQueryRanker::models_input_width { 224 }
static

◆ models_num_channels

const size_t sh::CanvasQueryRanker::models_num_channels { 3 }
static

◆ region_data

std::vector<FeatureMatrix> sh::CanvasQueryRanker::region_data
private

◆ resnet152

torch::jit::script::Module sh::CanvasQueryRanker::resnet152
private

◆ resnext101

torch::jit::script::Module sh::CanvasQueryRanker::resnext101
private

◆ RoIs

const std::vector<std::vector<float> > sh::CanvasQueryRanker::RoIs
private
Initial value:
= {
{ 0.0, 0.0, 1.0, 1.0 }, { 0.1, 0.2, 0.4, 0.6 }, { 0.3, 0.2, 0.4, 0.6 }, { 0.5, 0.2, 0.4, 0.6 },
{ 0.0, 0.0, 0.4, 0.6 }, { 0.2, 0.0, 0.4, 0.6 }, { 0.4, 0.0, 0.4, 0.6 }, { 0.6, 0.0, 0.4, 0.6 },
{ 0.0, 0.4, 0.4, 0.6 }, { 0.2, 0.4, 0.4, 0.6 }, { 0.4, 0.4, 0.4, 0.6 }, { 0.6, 0.4, 0.4, 0.6 },
}

◆ weights

torch::Tensor sh::CanvasQueryRanker::weights
private

The documentation for this class was generated from the following files: