Skip to content
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

Merged
merged 1 commit into from
Oct 28, 2022
Merged

rockchip resize flowunit code #293

merged 1 commit into from
Oct 28, 2022

Conversation

fujl
Copy link
Contributor

@fujl fujl commented Oct 10, 2022

rockchip resize flowunit code

include_directories(${LIBMODELBOX_BASE_INCLUDE})
include_directories(${LIBMODELBOX_DEVICE_ROCKCHIP_INCLUDE})
include_directories(${RKMPP_INCLUDE_DIR})
include_directories(${RKRGA_INCLUDE_DIR})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RKRGA_INCLUDE_DIR这两个变量哪里获取的?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@@ -0,0 +1,139 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License使用开源的

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用这个,直接用下面那个就可以了

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是应该返回错误?

Copy link
Contributor Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺少测试用例。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已加

@fujl fujl force-pushed the rkresize branch 2 times, most recently from 4b2308b to 51216c9 Compare October 11, 2022 02:05
}

if (dest_width_ < MIN_SIZE || dest_height_ < MIN_SIZE) {
MBLOG_ERROR << "Dest width or dest height must larger than 32, dest_width:"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该提示大于等于great equal than吧。

Copy link
Contributor Author

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 =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rk的输入输出数据的buffer和meta是否和cpu完全一样?有没有额外限制? 限制加入描述

Copy link
Contributor Author

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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参考其他resize 增加输入输出meta 说明

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加日志

Copy link
Contributor Author

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});
Copy link
Contributor

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,默认和功能单元一直

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@fujl fujl force-pushed the rkresize branch 6 times, most recently from 0b841c6 to e3d71a6 Compare October 17, 2022 06:30
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

输出数据没看到对比的地方

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

@fujl fujl force-pushed the rkresize branch 6 times, most recently from 9fd8e27 to 3606289 Compare October 26, 2022 08:27

protected:
void SetUp() override {
// Test rockchip runtime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有RKNPU的情况,应该跳过测试用例。

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个设置移动到device里面

@pymumu pymumu merged commit c80e20a into modelbox-ai:main Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants