23 #ifndef PT_SCENE_POSTERIOR_H
24 #define PT_SCENE_POSTERIOR_H
67 bool infer_head_off =
false
69 box_likelihood_(box_likelihood),
70 fm_likelihood_(fm_likelihood),
71 of_likelihood_(of_likelihood),
72 ff_likelihood_(ff_likelihood),
73 color_likelihood_(color_likelihood),
74 pos_prior_(pos_prior),
75 dir_prior_(dir_prior),
76 fdir_prior_(fdir_prior),
90 use_fdir_prior_(
true),
93 m_infer_head(!infer_head_off)
111 return local(target, target, scene, frame, frame);
192 return of_likelihood_;
201 return color_likelihood_;
223 mutable bool use_box_lh_;
224 mutable bool use_fm_lh_;
225 mutable bool use_of_lh_;
226 mutable bool use_ff_lh_;
227 mutable bool use_color_lh_;
228 mutable bool use_pos_prior_;
229 mutable bool use_dir_prior_;
230 mutable bool use_fdir_prior_;
231 mutable bool use_dim_prior_;
243 posterior_(post), adapter_(post.vis_off(), post.infer_head()) {}
249 boost::tie(tg_p, frame) = adapter_.
target_frame(&sc, i);
253 return posterior_.
local(*tg_p, sc, frame);
262 boost::tie(tg_p1, frame1) = adapter_.
target_frame(&sc, i);
263 boost::tie(tg_p2, frame2) = adapter_.
target_frame(&sc, j);
268 return posterior_.
local(*tg_p1, *tg_p2, sc, frame1, frame2);
283 const Scene_posterior& post,
const Face_flow_likelihood & ff_likelihood() const
Returns the face flow likelihood.
Definition: pt_scene_posterior.h:196
bool vis_off() const
Returns whether visibilities is being used.
Definition: pt_scene_posterior.h:156
Class that represents the prior distribution of a trajectory.
Definition: pt_direction_prior.h:33
std::pair< const Target *, size_t > target_frame(const Scene *s, size_t i) const
Get target and frame corresponding to variable i.
Definition: pt_scene_adapter.h:244
bool infer_head() const
Returns whether inferring head.
Definition: pt_scene_posterior.h:159
Adapts a Scene into a VectorModel for HMC sampling.
Definition: pt_scene_adapter.h:183
const Face_direction_prior & face_direction_prior() const
Returns the face direction prior.
Definition: pt_scene_posterior.h:169
Definition of various standard probability distributions.
Class to compute face optical flow likelihood.
Definition: pt_face_flow_likelihood.h:42
double get_entity_type_average_height(Entity_type type)
Get the average height of an entity.
Definition: tracking_entity.cpp:110
const Scene_adapter & adapter() const
Definition: pt_scene_posterior.h:271
double get_entity_type_average_girth(Entity_type type)
Get the average girth of an entity.
Definition: tracking_entity.cpp:138
bool & use_ff_lh() const
Returns whether or not we are using the FF likelihood.
Definition: pt_scene_posterior.h:138
Class to compute face optical flow likelihood.
Definition: pt_optical_flow_likelihood.h:43
const Optical_flow_likelihood & of_likelihood() const
Returns the optical flow likelihood.
Definition: pt_scene_posterior.h:190
Class that represents the prior distribution of the face direction.
Definition: pt_direction_prior.h:137
Class that represents a full scene in the PT universe.
Definition: pt_scene.h:40
const Facemark_likelihood & fm_likelihood() const
Returns the facemark likelihood.
Definition: pt_scene_posterior.h:187
bool & use_pos_prior() const
Returns whether or not we are using the position prior.
Definition: pt_scene_posterior.h:144
const Position_prior & position_prior() const
Returns the position prior.
Definition: pt_scene_posterior.h:163
const Normal_distribution & width_prior() const
Returns the width prior.
Definition: pt_scene_posterior.h:178
bool & use_dir_prior() const
Returns whether or not we are using the direction prior.
Definition: pt_scene_posterior.h:147
bool & use_fdir_prior() const
Returns whether or not we are using the face direction prior.
Definition: pt_scene_posterior.h:150
void reset() const
Definition: pt_scene_posterior.h:273
double dimension_prior(const Scene &scene) const
Computes the dimension prior of a scene.
Definition: pt_scene_posterior.cpp:239
#define IFT(a, ex, msg)
Definition: l_exception.h:101
bool & use_dim_prior() const
Returns whether or not we are using the dimension prior.
Definition: pt_scene_posterior.h:153
const Normal_distribution & height_prior() const
Returns the height prior.
Definition: pt_scene_posterior.h:175
St_perspective_camera for modeling a perspective camera using the classic Forsyth and Ponce parametri...
double get_entity_type_stddev_girth(Entity_type type)
Get the standard deviation of the girth of an entity.
Definition: tracking_entity.cpp:145
Posterior adapter to work with independent gradient computation.
Definition: pt_scene_posterior.h:239
void reset() const
Restart state.
Definition: pt_scene_adapter.h:240
bool & use_fm_lh() const
Returns whether or not we are using the facemark likelihood.
Definition: pt_scene_posterior.h:132
Entity_type get_entity_type(const std::string &name)
Get the type of a entity name.
Definition: tracking_entity.cpp:96
Class that represents the prior distribution of a trajectory.
Definition: pt_position_prior.h:34
Class that represents a target moving through space.
Definition: pt_target.h:50
bool & use_of_lh() const
Returns whether or not we are using the OF likelihood.
Definition: pt_scene_posterior.h:135
Class that represents likelihood of a set of projected boxes given. detections. At the moment it only...
Definition: pt_box_likelihood.h:42
const Box_likelihood & box_likelihood() const
Returns the box likelihood.
Definition: pt_scene_posterior.h:184
const Normal_distribution & girth_prior() const
Returns the girth prior.
Definition: pt_scene_posterior.h:181
bool & use_color_lh() const
Returns whether or not we are using the color likelihood.
Definition: pt_scene_posterior.h:141
Posterior distribution of a scene.
Definition: pt_scene_posterior.h:53
double get_entity_type_average_width(Entity_type type)
Get the average width of an entity.
Definition: tracking_entity.cpp:124
void write_posterior_details(const Scene_posterior &post, const Scene &scene, double mlh, std::ostream &ost)
Write the details of the posterior in a table format.
Definition: pt_scene_posterior.cpp:263
Scene_posterior_ind(const Scene_posterior &post)
Definition: pt_scene_posterior.h:242
boost::math::normal Normal_distribution
Definition: prob_distribution.h:68
const Color_likelihood & color_likelihood() const
Returns the color likelihood.
Definition: pt_scene_posterior.h:199
Class that represents color likelihood of a set of projected boxes given detections.
Definition: pt_color_likelihood.h:42
bool & use_box_lh() const
Returns whether or not we are using the box likelihood.
Definition: pt_scene_posterior.h:129
double get_entity_type_stddev_width(Entity_type type)
Get the standard deviation of the width of an entity.
Definition: tracking_entity.cpp:131
double get_entity_type_stddev_height(Entity_type type)
Get the standard deviation of the height of an entity.
Definition: tracking_entity.cpp:117
const Direction_prior & direction_prior() const
Returns the direction prior.
Definition: pt_scene_posterior.h:166
get the indices of edges in each direction for i
Definition: APPgetLargeConnectedEdges.m:48
Class to compute facemark likelihood.
Definition: pt_facemark_likelihood.h:39
double operator()(const Scene &sc, size_t i) const
Definition: pt_scene_posterior.h:245
double local(const Target &target, const Scene &scene, size_t frame) const
Computes the likelihood of a scene where only a single item moved.
Definition: pt_scene_posterior.h:105
Object thrown when computation fails somehow during execution.
Definition: l_exception.h:321
double operator()(const Scene &scene) const
Computes the posterior of a scene.
Definition: pt_scene_posterior.cpp:52
double operator()(const Scene &sc, size_t i, size_t j) const
Definition: pt_scene_posterior.h:256
Scene_posterior(const Box_likelihood &box_likelihood, const Facemark_likelihood &fm_likelihood, const Optical_flow_likelihood &of_likelihood, const Face_flow_likelihood &ff_likelihood, const Color_likelihood &color_likelihood, const Position_prior &pos_prior, const Direction_prior &dir_prior, const Face_direction_prior &fdir_prior, bool vis_off=false, bool infer_head_off=false)
Definition: pt_scene_posterior.h:57