Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
fateshelled committed Jun 14, 2024
1 parent 41c9925 commit e72a7d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion yolov9mit_ros/yolov9mit/include/yolov9mit/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ class AbcYOLOV9MIT
{
public:
AbcYOLOV9MIT() {}
AbcYOLOV9MIT(float min_iou = 0.45, float min_confidence = 0.3, size_t num_classes = 80)
AbcYOLOV9MIT(float min_iou = 0.45f, float min_confidence = 0.6f, size_t num_classes = 80)
: min_iou_(min_iou), min_confidence_(min_confidence), num_classes_(num_classes)
{
}
virtual std::vector<Object> inference(const cv::Mat &frame) = 0;

private:
inline float sigmoid(const float x) { return 1.0f / (1.0f + std::exp(-x)); }

protected:
size_t input_w_;
size_t input_h_;
Expand Down Expand Up @@ -90,6 +93,7 @@ class AbcYOLOV9MIT

for (size_t class_idx = 0; class_idx < num_classes_; ++class_idx)
{
// const float conf = sigmoid(prob_classes[idx + class_idx]);
const float conf = prob_classes[idx + class_idx];
if (conf > max_confidence)
{
Expand Down
2 changes: 1 addition & 1 deletion yolov9mit_ros/yolov9mit_ros/src/yolov9mit_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ YOLOV9MIT_Node::YOLOV9MIT_Node(const rclcpp::NodeOptions &options) : Node("yolov
const auto model_path =
this->declare_parameter(param_prefix + "model_path", "yolov9mit_with_post.sim.engine");
const auto min_iou = this->declare_parameter(param_prefix + "min_iou", 0.5f);
const auto min_confidence = this->declare_parameter(param_prefix + "min_confidence", 0.5f);
const auto min_confidence = this->declare_parameter(param_prefix + "min_confidence", 0.6f);
const auto class_label_path = this->declare_parameter(param_prefix + "class_label_path", "");
const auto model_type = this->declare_parameter(param_prefix + "model_type", "tensorrt");
const auto tensorrt_device = this->declare_parameter(param_prefix + "tensorrt_device", 0);
Expand Down

0 comments on commit e72a7d2

Please sign in to comment.