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

【PaddlePaddle Hackathon 2】63、在 Paddle-Lite-Demo 中添加 yolo-v5 模型在安卓上的 Demo #237

Merged
merged 9 commits into from
May 5, 2022

Conversation

thunder95
Copy link
Contributor

新增yolov5的安卓demo, 支持adb shell, cpu和gpu, 模型链接:
https://pan.baidu.com/s/1Qn5jh5puuAL936WviU9bkw
提取码:x2rf

@thunder95
Copy link
Contributor Author

Precommit 失败,但是无法查看details, 账号不存在

@chenjiaoAngel
Copy link
Collaborator

image

代码格式没有通过,建议安装 pre-commit,例如:pip install pre-commit 然后:pre-commit run -a

Copy link
Collaborator

@chenjiaoAngel chenjiaoAngel left a comment

Choose a reason for hiding this comment

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

assets 目录下的images 和 labels 是不是忘了上传呢?

}

/*
out.convertTo(out, CV_32FC3, 1.0 / 255.0f);
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个是没有用吗?如果是,可以delete
另外,这个输入数据不需要预处理吗?如-means/scales

Copy link
Contributor Author

Choose a reason for hiding this comment

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

暂时没有用,经测试使用这部分注释的代码性能没有明显变化,预处理不需要mean/scale

Copy link
Contributor Author

Choose a reason for hiding this comment

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

assets 目录下的images 和 labels, 没有使用新的测试image和label, 用了picodet的dog.jpg以及coco_label_list.txt

@chenjiaoAngel
Copy link
Collaborator

在目录 tools/ci_tools 下,在 android_demo_ci.sh 脚本中的compile_object_detection方法里, 这个位置添加 yolov5_detection shell demo的V7/V8 单测测试。我们CI 会线上跑这个demo,以验证能否正常运行
image

@thunder95
Copy link
Contributor Author

之前运行过pre-commit, 出现了./tools/codestyle/cpplint_pre_commit.hook: 行 23: cpplint:未找到命令

@thunder95
Copy link
Contributor Author

@chenjiaoAngel CI还是没通过,details也打不开(提示用户不存在),不知道错哪里了

@thunder95
Copy link
Contributor Author

@chenjiaoAngel codestyle已经改了, 但是跑paddle-lite-demo失败, details也无法登录看不了,麻烦看看呢?

@@ -0,0 +1,35 @@
#!/bin/bash
# setting NDK_ROOT root
export NDK_ROOT=/home/shtf/Android/Sdk/ndk/24.0.8215888/
Copy link
Contributor

Choose a reason for hiding this comment

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

运行ci机器的NDK路径是:export NDK_ROOT=/opt/android-ndk-r20b,设置成你本地的路径会找不到编译器

Copy link
Contributor Author

Choose a reason for hiding this comment

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

完成

mkdir build
#make clean
cd build
cmake -DANDROID_PLATFORM=android-24 -DPADDLE_LITE_DIR=${PADDLE_LITE_DIR} -DARM_ABI=${ARM_ABI} -DARM_TARGET_LANG=${ARM_TARGET_LANG} -DOPENCV_LITE_DIR=${OPENCV_LITE_DIR} -DNDK_ROOT=${NDK_ROOT} ..
Copy link
Contributor

Choose a reason for hiding this comment

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

ANDROID_PLATFORM 建议和其他demo一致设置为21,以支持低版本

Copy link
Contributor Author

Choose a reason for hiding this comment

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

完成

std::sort(dets.begin(), dets.end(), cmp);
for (size_t m = 0; m < dets.size(); ++m) {
auto &item = dets[m];
res.push_back(item);
Copy link
Contributor

Choose a reason for hiding this comment

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

res是个指针,编译失败,还有其他错误,你可以把NDK路径先改回去本地编译一下试试

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mjp9527 老师您好,之前修改codeformat出的问题,已经修改好。 上传之后,10个小时了还在pending, 麻烦看下

Copy link
Collaborator

@chenjiaoAngel chenjiaoAngel left a comment

Choose a reason for hiding this comment

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

LGTM

@chenjiaoAngel chenjiaoAngel merged commit c899b2b into PaddlePaddle:develop May 5, 2022
HydrogenSulfate pushed a commit to HydrogenSulfate/Paddle-Lite-Demo that referenced this pull request Aug 12, 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.

3 participants