ruinmessi commited on
Commit
124e648
·
1 Parent(s): a1099bb

fix(YOLOX): fix bug in trt demo and cpp (#116)

Browse files
demo/OpenVINO/cpp/yolox_openvino.cpp CHANGED
@@ -82,7 +82,7 @@ struct GridAndStride
82
  int stride;
83
  };
84
 
85
- static int generate_grids_and_stride(const int target_size, std::vector<int>& strides, std::vector<GridAndStride>& grid_strides)
86
  {
87
  for (auto stride : strides)
88
  {
 
82
  int stride;
83
  };
84
 
85
+ static void generate_grids_and_stride(const int target_size, std::vector<int>& strides, std::vector<GridAndStride>& grid_strides)
86
  {
87
  for (auto stride : strides)
88
  {
demo/TensorRT/cpp/yolox.cpp CHANGED
@@ -60,7 +60,7 @@ struct GridAndStride
60
  int stride;
61
  };
62
 
63
- static int generate_grids_and_stride(const int target_size, std::vector<int>& strides, std::vector<GridAndStride>& grid_strides)
64
  {
65
  for (auto stride : strides)
66
  {
 
60
  int stride;
61
  };
62
 
63
+ static void generate_grids_and_stride(const int target_size, std::vector<int>& strides, std::vector<GridAndStride>& grid_strides)
64
  {
65
  for (auto stride : strides)
66
  {
demo/ncnn/cpp/yolox.cpp CHANGED
@@ -175,7 +175,7 @@ static void nms_sorted_bboxes(const std::vector<Object>& faceobjects, std::vecto
175
  }
176
  }
177
 
178
- static int generate_grids_and_stride(const int target_size, std::vector<int>& strides, std::vector<GridAndStride>& grid_strides)
179
  {
180
  for (auto stride : strides)
181
  {
 
175
  }
176
  }
177
 
178
+ static void generate_grids_and_stride(const int target_size, std::vector<int>& strides, std::vector<GridAndStride>& grid_strides)
179
  {
180
  for (auto stride : strides)
181
  {
tools/demo.py CHANGED
@@ -125,8 +125,6 @@ class Predictor(object):
125
  outputs = self.model(img)
126
  if self.decoder is not None:
127
  outputs = self.decoder(outputs, dtype=outputs.type())
128
- if self.device == "gpu":
129
- outputs = outputs.cpu().numpy()
130
  outputs = postprocess(
131
  outputs, self.num_classes, self.confthre, self.nmsthre
132
  )
 
125
  outputs = self.model(img)
126
  if self.decoder is not None:
127
  outputs = self.decoder(outputs, dtype=outputs.type())
 
 
128
  outputs = postprocess(
129
  outputs, self.num_classes, self.confthre, self.nmsthre
130
  )