Skip to content

Commit 6833b93

Browse files
committed
[update] update depth_anything.
1 parent 795e74f commit 6833b93

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

projects/llm_framework/main_depth_anything/src/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class llm_task {
160160
cv::Mat camera_data(mode_config_.img_h, mode_config_.img_w, CV_8UC2, (void *)msg.data());
161161
cv::Mat rgb;
162162
cv::cvtColor(camera_data, rgb, cv::COLOR_YUV2RGB_YUYV);
163-
return inference(rgb, false);
163+
return inference(rgb, true);
164164
}
165165

166166
bool inference_raw_rgb(const std::string &msg)
@@ -195,13 +195,14 @@ class llm_task {
195195
int ret = -1;
196196
std::vector<uint8_t> image(mode_config_.img_w * mode_config_.img_h * 3, 0);
197197
common::get_input_data_no_letterbox(src, image, mode_config_.img_h, mode_config_.img_w, bgr2rgb);
198+
cv::Mat img_mat(mode_config_.img_h, mode_config_.img_w, CV_8UC3, image.data());
198199
depth_anything_->SetInput((void *)image.data(), 0);
199200
if (0 != depth_anything_->RunSync()) {
200201
SLOGE("Run depth_anything model failed!\n");
201202
throw std::string("depth_anything_ RunSync error");
202203
}
203204
std::vector<detection::Object> objects;
204-
depth_anything_->Post_Process(src, mode_config_.model_type);
205+
depth_anything_->Post_Process(img_mat, mode_config_.model_type);
205206
std::vector<nlohmann::json> depth_anything_output;
206207
if (out_callback_) out_callback_(depth_anything_output, true);
207208
} catch (...) {

projects/llm_framework/main_yolo/src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,14 @@ class llm_task {
199199
int ret = -1;
200200
std::vector<uint8_t> image(mode_config_.img_w * mode_config_.img_h * 3, 0);
201201
common::get_input_data_letterbox(src, image, mode_config_.img_h, mode_config_.img_w, bgr2rgb);
202+
cv::Mat img_mat(mode_config_.img_h, mode_config_.img_w, CV_8UC3, image.data());
202203
yolo_->SetInput((void *)image.data(), 0);
203204
if (0 != yolo_->RunSync()) {
204205
SLOGE("Run yolo model failed!\n");
205206
throw std::string("yolo_ RunSync error");
206207
}
207208
std::vector<detection::Object> objects;
208-
yolo_->Post_Process(src, mode_config_.img_w, mode_config_.img_h, mode_config_.cls_num,
209+
yolo_->Post_Process(img_mat, mode_config_.img_w, mode_config_.img_h, mode_config_.cls_num,
209210
mode_config_.pron_threshold, mode_config_.nms_threshold, objects,
210211
mode_config_.model_type);
211212
std::vector<nlohmann::json> yolo_output;

0 commit comments

Comments
 (0)