Darknet/YOLO v3.0-97-g3520881-dirty
Object Detection Framework
 
Loading...
Searching...
No Matches
Detector Class Reference

#include "yolo_v2_class.hpp"

Collaboration diagram for Detector:

Public Member Functions

 Detector (std::string cfg_filename, std::string weight_filename, int gpu_id=0, int batch_size=1)
 
 ~Detector ()
 
std::vector< bbox_tdetect (cv::Mat mat, float thresh=0.2, bool use_mean=false)
 
std::vector< bbox_tdetect (image_t img, float thresh=0.2, bool use_mean=false)
 
std::vector< bbox_tdetect (std::string image_filename, float thresh=0.2, bool use_mean=false)
 
std::vector< bbox_tdetect_resized (image_t img, int init_w, int init_h, float thresh=0.2, bool use_mean=false)
 
std::vector< std::vector< bbox_t > > detectBatch (image_t img, int batch_size, int width, int height, float thresh, bool make_nms=true)
 
void * get_cuda_context ()
 
int get_net_color_depth () const
 
int get_net_height () const
 
int get_net_width () const
 
std::shared_ptr< image_tmat_to_image_resize (cv::Mat mat) const
 
bool send_json_http (std::vector< bbox_t > cur_bbox_vec, std::vector< std::string > obj_names, int frame_id, std::string filename=std::string(), int timeout=400000, int port=8070)
 
std::vector< bbox_ttracking_id (std::vector< bbox_t > cur_bbox_vec, bool const change_history=true, int const frames_story=5, int const max_dist=40)
 

Static Public Member Functions

static void free_image (image_t m)
 
static image_t load_image (std::string image_filename)
 
static std::shared_ptr< image_tmat_to_image (cv::Mat img_src)
 

Public Attributes

const int cur_gpu_id
 
float nms = .4
 
bool wait_stream
 

Static Private Member Functions

static image_t make_empty_image (int w, int h, int c)
 
static image_t make_image_custom (int w, int h, int c)
 
static image_t mat_to_image_custom (cv::Mat mat)
 

Private Attributes

std::string _cfg_filename
 
std::string _weight_filename
 
std::shared_ptr< void > detector_gpu_ptr
 
std::deque< std::vector< bbox_t > > prev_bbox_vec_deque
 

Constructor & Destructor Documentation

◆ Detector()

Detector::Detector ( std::string  cfg_filename,
std::string  weight_filename,
int  gpu_id = 0,
int  batch_size = 1 
)
Here is the call graph for this function:

◆ ~Detector()

Detector::~Detector ( )
Here is the call graph for this function:

Member Function Documentation

◆ detect() [1/3]

std::vector< bbox_t > Detector::detect ( cv::Mat  mat,
float  thresh = 0.2,
bool  use_mean = false 
)
inline
Here is the call graph for this function:

◆ detect() [2/3]

std::vector< bbox_t > Detector::detect ( image_t  img,
float  thresh = 0.2,
bool  use_mean = false 
)
Here is the call graph for this function:

◆ detect() [3/3]

std::vector< bbox_t > Detector::detect ( std::string  image_filename,
float  thresh = 0.2,
bool  use_mean = false 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ detect_resized()

std::vector< bbox_t > Detector::detect_resized ( image_t  img,
int  init_w,
int  init_h,
float  thresh = 0.2,
bool  use_mean = false 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ detectBatch()

std::vector< std::vector< bbox_t > > Detector::detectBatch ( image_t  img,
int  batch_size,
int  width,
int  height,
float  thresh,
bool  make_nms = true 
)
Here is the call graph for this function:

◆ free_image()

void Detector::free_image ( image_t  m)
static
Here is the caller graph for this function:

◆ get_cuda_context()

void * Detector::get_cuda_context ( )
Here is the call graph for this function:

◆ get_net_color_depth()

int Detector::get_net_color_depth ( ) const

◆ get_net_height()

int Detector::get_net_height ( ) const
Here is the caller graph for this function:

◆ get_net_width()

int Detector::get_net_width ( ) const
Here is the caller graph for this function:

◆ load_image()

image_t Detector::load_image ( std::string  image_filename)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_empty_image()

static image_t Detector::make_empty_image ( int  w,
int  h,
int  c 
)
inlinestaticprivate
Here is the caller graph for this function:

◆ make_image_custom()

static image_t Detector::make_image_custom ( int  w,
int  h,
int  c 
)
inlinestaticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mat_to_image()

static std::shared_ptr< image_t > Detector::mat_to_image ( cv::Mat  img_src)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mat_to_image_custom()

static image_t Detector::mat_to_image_custom ( cv::Mat  mat)
inlinestaticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mat_to_image_resize()

std::shared_ptr< image_t > Detector::mat_to_image_resize ( cv::Mat  mat) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_json_http()

bool Detector::send_json_http ( std::vector< bbox_t cur_bbox_vec,
std::vector< std::string >  obj_names,
int  frame_id,
std::string  filename = std::string(),
int  timeout = 400000,
int  port = 8070 
)
inline

◆ tracking_id()

std::vector< bbox_t > Detector::tracking_id ( std::vector< bbox_t cur_bbox_vec,
bool const  change_history = true,
int const  frames_story = 5,
int const  max_dist = 40 
)

Member Data Documentation

◆ _cfg_filename

std::string Detector::_cfg_filename
private

◆ _weight_filename

std::string Detector::_weight_filename
private

◆ cur_gpu_id

const int Detector::cur_gpu_id

◆ detector_gpu_ptr

std::shared_ptr<void> Detector::detector_gpu_ptr
private

◆ nms

float Detector::nms = .4

◆ prev_bbox_vec_deque

std::deque<std::vector<bbox_t> > Detector::prev_bbox_vec_deque
private

◆ wait_stream

bool Detector::wait_stream

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