-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rockchip resize flowunit code #293
Conversation
include_directories(${LIBMODELBOX_BASE_INCLUDE}) | ||
include_directories(${LIBMODELBOX_DEVICE_ROCKCHIP_INCLUDE}) | ||
include_directories(${RKMPP_INCLUDE_DIR}) | ||
include_directories(${RKRGA_INCLUDE_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RKRGA_INCLUDE_DIR这两个变量哪里获取的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
@@ -0,0 +1,139 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License使用开源的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
|
||
modelbox::Status ResizeFlowUnit::Open( | ||
const std::shared_ptr<modelbox::Configuration> &opts) { | ||
dest_width_ = opts->GetUint32("width", 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不用这个,直接用下面那个就可以了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
in_image->Get("pix_fmt", pix_fmt); | ||
rga_fmt = modelbox::GetRGAFormat(pix_fmt); | ||
if (rga_fmt == RK_FORMAT_UNKNOWN) { | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是不是应该返回错误?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已处理
@@ -0,0 +1,64 @@ | |||
# Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
缺少测试用例。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已加
4b2308b
to
51216c9
Compare
} | ||
|
||
if (dest_width_ < MIN_SIZE || dest_height_ < MIN_SIZE) { | ||
MBLOG_ERROR << "Dest width or dest height must larger than 32, dest_width:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该提示大于等于great equal than吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
|
||
constexpr const char *FLOWUNIT_TYPE = "rockchip"; | ||
constexpr const char *FLOWUNIT_NAME = "resize"; | ||
constexpr const char *FLOWUNIT_DESC = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rk的输入输出数据的buffer和meta是否和cpu完全一样?有没有额外限制? 限制加入描述
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一样的,已经补充描述
constexpr const char *FLOWUNIT_NAME = "resize"; | ||
constexpr const char *FLOWUNIT_DESC = | ||
"A resize flowunit on RockChip, one image as input, one resize image as " | ||
"output"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
参考其他resize 增加输入输出meta 说明
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已加
auto out_image = modelbox::CreateEmptyMppImg(dest_width_, dest_height_, | ||
rga_fmt, device, out_buf); | ||
if (out_image == nullptr) { | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加日志
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已增加
rk_resize_desc.SetFlowUnitName(FLOWUNIT_NAME); | ||
rk_resize_desc.SetFlowUnitGroupType("Image"); | ||
rk_resize_desc.AddFlowUnitInput({IN_IMG, modelbox::DEVICE_TYPE}); | ||
rk_resize_desc.AddFlowUnitOutput({OUT_IMG, modelbox::DEVICE_TYPE}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AddFlowUnitInput
AddFlowUnitOutput
按照新接口写,不用设置 modelbox::DEVICE_TYPE,默认和功能单元一直
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
0b841c6
to
e3d71a6
Compare
ASSERT_EQ(output_buffer_list->Size(), 1); | ||
auto output_buffer = output_buffer_list->At(0); | ||
ASSERT_EQ(output_buffer->GetBytes(), 112 * 110 * 3 / 2); | ||
cv::Mat yuv_out_img(110 * 3 / 2, 112, CV_8UC1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
输出数据没看到对比的地方
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
9fd8e27
to
3606289
Compare
|
||
protected: | ||
void SetUp() override { | ||
// Test rockchip runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有RKNPU的情况,应该跳过测试用例。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改为初始化jpge_decode失败跳过测试用例
rk_resize_desc.AddFlowUnitInput({IN_IMG}); | ||
rk_resize_desc.AddFlowUnitOutput({OUT_IMG}); | ||
rk_resize_desc.SetFlowType(modelbox::NORMAL); | ||
rk_resize_desc.SetInputContiguous(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个设置移动到device里面
rockchip resize flowunit code