提交 d95857ff 编写于 作者: C Calvin Miao 提交者: Jiangtao Hu

Perception: used log in cybertron log system

上级 447d2e8a
......@@ -97,7 +97,7 @@ bool ResizeCPU(const base::Blob<uint8_t> &src_blob,
int origin_height = src_blob.shape(1);
int origin_width = src_blob.shape(2);
if (origin_channel != dst_blob->shape(3)) {
LOG(ERROR) << "channel should be the same after resize.";
AERROR << "channel should be the same after resize.";
return false;
}
float fx = static_cast<float>(origin_width) / static_cast<float>(width);
......
......@@ -13,6 +13,7 @@ cuda_library(
],
deps = [
"@cuda",
"//cybertron",
"//modules/perception/camera/common:common",
"//modules/perception/inference/utils:inference_util_lib",
"//modules/perception/inference/utils:inference_gemm_lib",
......
......@@ -14,8 +14,11 @@
* limitations under the License.
*****************************************************************************/
#include "modules/perception/camera/lib/obstacle/tracker/common/similar.h"
#include <cblas.h>
#include <memory>
#include "cybertron/common/log.h"
#include "modules/perception/camera/common/util.h"
#include "modules/perception/inference/utils/gemm.h"
......@@ -34,7 +37,7 @@ bool GPUSimilar::Calc(CameraFrame *frame1,
sim->Reshape({n, m});
if (frame1->track_feature_blob == nullptr) {
LOG(ERROR) << "No feature blob";
AERROR << "No feature blob";
return false;
}
int dim = frame1->track_feature_blob->count(1);
......
......@@ -102,19 +102,19 @@ class DSTEvidenceTest : public ::testing::Test {
for (size_t i = 0; i < fused_spt_gt.size(); ++i) {
fused_uct_gt[i] = fused_pls_gt[i] - fused_spt_gt[i];
}
LOG(INFO) << fused_dst_.PrintBba();
AINFO << fused_dst_.PrintBba();
// double sum = std::accumulate(fused_dst__vec.begin(),
// fused_dst__vec.end(), 0.0);
// LOG(INFO) << boost::format("fused dst sum: %lf") % sum;
LOG(INFO) << "check dst";
// AINFO << boost::format("fused dst sum: %lf") % sum;
AINFO << "check dst";
vec_equal_(fused_dst_vec_, fused_dst_gt);
LOG(INFO) << "check spt";
AINFO << "check spt";
vec_equal_(fused_spt_vec_, fused_spt_gt);
LOG(INFO) << "check pls";
AINFO << "check pls";
vec_equal_(fused_pls_vec_, fused_pls_gt);
LOG(INFO) << "check uct";
AINFO << "check uct";
vec_equal_(fused_uct_vec_, fused_uct_gt);
LOG(INFO) << "check prob";
AINFO << "check prob";
vec_equal_(fused_prob_vec_, fused_prob_gt);
}
void add_dst_test2() {
......@@ -136,16 +136,16 @@ class DSTEvidenceTest : public ::testing::Test {
for (size_t i = 0; i < fused_spt_gt.size(); ++i) {
fused_uct_gt[i] = fused_pls_gt[i] - fused_spt_gt[i];
}
LOG(INFO) << fused_dst_.PrintBba();
LOG(INFO) << "check dst";
AINFO << fused_dst_.PrintBba();
AINFO << "check dst";
vec_equal_(fused_dst_vec_, fused_dst_gt);
LOG(INFO) << "check spt";
AINFO << "check spt";
vec_equal_(fused_spt_vec_, fused_spt_gt);
LOG(INFO) << "check pls";
AINFO << "check pls";
vec_equal_(fused_pls_vec_, fused_pls_gt);
LOG(INFO) << "check uct";
AINFO << "check uct";
vec_equal_(fused_uct_vec_, fused_uct_gt);
LOG(INFO) << "check prob";
AINFO << "check prob";
vec_equal_(fused_prob_vec_, fused_prob_gt);
}
void multipy_dst_test() {
......@@ -157,7 +157,7 @@ class DSTEvidenceTest : public ::testing::Test {
dst.SetBbaVec(dst_data);
Dst res("test");
res = dst * 0.8;
LOG(INFO) << res.PrintBba();
AINFO << res.PrintBba();
vec_equal_(res.GetBbaVec(), gt);
}
......
......@@ -31,7 +31,7 @@ bool ReadProtoFromTextFile(const std::string &filename,
google::protobuf::Message *proto) {
int fd = open(filename.c_str(), O_RDONLY);
if (fd < 0) {
LOG(INFO) << "cannot open file " << filename;
AERROR << "cannot open file " << filename;
return false;
}
google::protobuf::io::FileInputStream raw_input(fd);
......@@ -46,7 +46,7 @@ bool ReadProtoFromBinaryFile(const std::string &filename,
google::protobuf::Message *proto) {
int fd = open(filename.c_str(), O_RDONLY);
if (fd < 0) {
LOG(INFO) << "cannot open file " << filename;
AERROR << "cannot open file " << filename;
return false;
}
google::protobuf::io::FileInputStream raw_input(fd);
......
......@@ -26,7 +26,6 @@
#include "modules/perception/inference/utils/gemm.h"
#include "modules/perception/inference/utils/resize.h"
#include "modules/perception/inference/utils/util.h"
#include "modules/perception/perception_base/base/log.h"
namespace apollo {
namespace perception {
......@@ -126,7 +125,6 @@ void CudaUtilFun(int gpu_count, int thread_id) {
EXPECT_TRUE(inference::CudaUtil::set_device_id(i));
}
handlers[thread_id] = inference::CudaUtil::get_handler();
LOG_INFO << "Thread " << thread_id << " exit";
}
TEST(UtilTest, CudaUtilTest) {
......
......@@ -63,7 +63,7 @@ int main(int argc, char **argv) {
apollo::perception::inference::load_data<std::string>(FLAGS_names_file,
&outputs);
for (auto name : outputs) {
LOG(INFO) << name;
ADEBUG << name;
}
if (FLAGS_int8) {
......@@ -94,7 +94,7 @@ int main(int argc, char **argv) {
for (auto image_file : image_lists) {
cv::Mat img =
cv::imread(FLAGS_image_root + image_file + FLAGS_image_ext, CV_8UC1);
LOG(INFO) << img.channels();
ADEBUG << img.channels();
cv::Rect roi(0, offset_y, img.cols, img.rows - offset_y);
cv::Mat img_roi = img(roi);
img_roi.copyTo(img);
......
......@@ -18,6 +18,7 @@
#include <algorithm>
#include "cybertron/common/log.h"
#include "modules/perception/inference/utils/util.h"
#include "modules/perception/inference/utils/cuda_util.h"
......@@ -169,7 +170,7 @@ bool ResizeGPU(const base::Image8U &src,
int origin_width = src.cols();
if (origin_channel != dst->shape(3)) {
LOG(ERROR) << "channel should be the same after resize.";
AERROR << "channel should be the same after resize.";
return false;
}
float fx = static_cast<float>(origin_width) / static_cast<float>(width);
......@@ -213,7 +214,7 @@ bool ResizeGPU(const apollo::perception::base::Blob<uint8_t> &src_gpu,
// SRC: 1 H W C
// DST: 1 H W C
if (origin_channel != channel) {
LOG(ERROR) << "channel should be the same after resize.";
AERROR << "channel should be the same after resize.";
return false;
}
......@@ -259,7 +260,7 @@ bool ResizeGPU(const base::Image8U &src,
// SRC: 1 H W C
// DST: 1 H W C
if (origin_channel != channel) {
LOG(ERROR) << "channel should be the same after resize.";
AERROR << "channel should be the same after resize.";
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册