@@ -120,19 +120,19 @@ TrtRTMDet::TrtRTMDet(
120
120
121
121
input_d_ = autoware::cuda_utils::make_unique<float []>(
122
122
batch_size_ * input_dims.d [1 ] * input_dims.d [2 ] * input_dims.d [3 ]);
123
- out_dets_d_ = autoware::cuda_utils::make_unique<float []>(batch_size_ * max_detections_ * 5 );
123
+ out_detections_d_ = autoware::cuda_utils::make_unique<float []>(batch_size_ * max_detections_ * 5 );
124
124
out_labels_d_ = autoware::cuda_utils::make_unique<int32_t []>(batch_size_ * max_detections_);
125
125
out_masks_d_ = autoware::cuda_utils::make_unique<float []>(
126
126
batch_size_ * max_detections_ * model_input_width_ * model_input_height_);
127
127
128
- out_dets_h_ = std::make_unique<float []>(batch_size_ * max_detections_ * 5 );
128
+ out_detections_h_ = std::make_unique<float []>(batch_size_ * max_detections_ * 5 );
129
129
out_labels_h_ = std::make_unique<int32_t []>(batch_size_ * max_detections_);
130
130
out_masks_h_ = std::make_unique<float []>(
131
131
batch_size_ * max_detections_ * model_input_width_ * model_input_height_);
132
132
133
133
#if (NV_TENSORRT_MAJOR * 1000) + (NV_TENSORRT_MINOR * 100) + NV_TENSOR_PATCH >= 8050
134
134
std::vector<void *> buffers = {
135
- input_d_.get (), out_dets_d_ .get (), out_labels_d_.get (), out_masks_d_.get ()};
135
+ input_d_.get (), out_detections_d_ .get (), out_labels_d_.get (), out_masks_d_.get ()};
136
136
trt_common_->setupBindings (buffers);
137
137
#endif
138
138
}
@@ -238,12 +238,12 @@ bool TrtRTMDet::feedforward(
238
238
#endif
239
239
240
240
const auto batch_size = images.size ();
241
- out_dets_h_ .reset (new float [batch_size_ * max_detections_ * 5 ]);
241
+ out_detections_h_ .reset (new float [batch_size_ * max_detections_ * 5 ]);
242
242
out_labels_h_.reset (new int32_t [batch_size_ * max_detections_]);
243
243
out_masks_h_.reset (new float [batch_size_ * 20 * model_input_width_ * model_input_height_]);
244
244
245
245
CHECK_CUDA_ERROR (cudaMemcpyAsync (
246
- out_dets_h_ .get (), out_dets_d_ .get (), sizeof (float ) * batch_size_ * max_detections_ * 5 ,
246
+ out_detections_h_ .get (), out_detections_d_ .get (), sizeof (float ) * batch_size_ * max_detections_ * 5 ,
247
247
cudaMemcpyDeviceToHost, *stream_));
248
248
CHECK_CUDA_ERROR (cudaMemcpyAsync (
249
249
out_labels_h_.get (), out_labels_d_.get (), sizeof (int32_t ) * batch_size_ * max_detections_,
@@ -260,22 +260,22 @@ bool TrtRTMDet::feedforward(
260
260
for (size_t batch = 0 ; batch < batch_size; ++batch) {
261
261
ObjectArray object_array;
262
262
for (uint32_t index = 0 ; index < max_detections_; ++index ) {
263
- if (out_dets_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 4 )] < score_threshold_) {
263
+ if (out_detections_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 4 )] < score_threshold_) {
264
264
break ;
265
265
}
266
266
267
267
Object object{};
268
268
object.mask_index = index ;
269
269
object.class_id = out_labels_h_[(batch * max_detections_) + index ];
270
270
object.x1 = static_cast <uint32_t >(
271
- out_dets_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 0 )] / scale_width_);
271
+ out_detections_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 0 )] / scale_width_);
272
272
object.y1 = static_cast <uint32_t >(
273
- out_dets_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 1 )] / scale_height_);
273
+ out_detections_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 1 )] / scale_height_);
274
274
object.x2 = static_cast <uint32_t >(
275
- out_dets_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 2 )] / scale_width_);
275
+ out_detections_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 2 )] / scale_width_);
276
276
object.y2 = static_cast <uint32_t >(
277
- out_dets_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 3 )] / scale_height_);
278
- object.score = out_dets_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 4 )];
277
+ out_detections_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 3 )] / scale_height_);
278
+ object.score = out_detections_h_ [(batch * max_detections_ * 5 ) + ((5 * index ) + 4 )];
279
279
object_array.push_back (object);
280
280
}
281
281
ObjectArray nms_objects;
0 commit comments