{"id":701,"date":"2024-05-06T08:00:53","date_gmt":"2024-05-06T00:00:53","guid":{"rendered":"https:\/\/www.zhoubin.asia\/?p=701"},"modified":"2024-05-02T07:03:39","modified_gmt":"2024-05-01T23:03:39","slug":"yolov8-pose","status":"publish","type":"post","link":"https:\/\/www.zhoubin.asia\/index.php\/2024\/05\/06\/yolov8-pose\/","title":{"rendered":"[yolov8-pose]RK3588 Rockit Demo \u59ff\u6001\u68c0\u6d4b\u540e\u5904\u7406\u6027\u80fd\u4f18\u5316"},"content":{"rendered":"<p>\u6700\u8fd1\u6709\u5c1d\u8bd5\u5c06github\u4e2dyolov8-pose\u7684C++\u4ee3\u7801\u6574\u5408\u8fdb\u5165rockit demo\uff0c\u65b9\u4fbfrockit demo\u4e5f\u80fd\u5c55\u793apose\u6548\u679c\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/hailo-ai\/Hailo-Application-Code-Examples\/tree\/main\/runtime\/cpp\/pose_estimation\/yolov8_pose\">Github Repository<\/a><\/p>\n<p>\u6574\u5408\u8fdb\u5165\u540e\uff0c\u53d1\u73b0\u5176\u540e\u5904\u7406\uff08\u51fd\u6570decode_boxes_and_keypoints\uff09\u5927\u7ea6\u9700\u898150ms\uff0c\u6781\u5176\u7684\u4e0d\u6b63\u5e38\u3002<\/p>\n<p>\u901a\u8fc7\u8c03\u8bd5\uff0c<br \/>\na. \u4ee3\u7801\u7247\u6bb5\uff1a<\/p>\n<pre><code>auto centers = get_centers(std::ref(strides), std::ref(network_dims), raw_boxes_outputs.size(), strided_width, strided_height);<\/code><\/pre>\n<p>\u8017\u65f620ms\u5de6\u53f3.<br \/>\nb. \u4e09\u6b21box\u4e0ekeypoint\u7684\u6570\u636e\u6574\u7406\u8017\u65f615ms\u5de6\u53f3\uff08\u7279\u522b\u662f 6400\u7684\u90a3\u6b21\u6570\u636e\u6574\u7406\u9700\u8981\u8017\u65f612ms\u5de6\u53f3\uff0c\u8fdc\u8fdc\u5927\u4e8e1600 2ms\u5de6\u53f3\u76844\u500d\uff09<\/p>\n<pre><code>        \/\/ Boxes setup\r\n        float32_t qp_scale = raw_boxes_outputs[i]-&gt;vstream_info().quant_info.qp_scale;\r\n        float32_t qp_zp = raw_boxes_outputs[i]-&gt;vstream_info().quant_info.qp_zp;\r\n\r\n        auto output_b = common::get_xtensor(raw_boxes_outputs[i]);\r\n        int num_proposals = output_b.shape(0) * output_b.shape(1);\r\n        auto output_boxes = xt::view(output_b, xt::all(), xt::all(), xt::all());\r\n        xt::xarray&lt;uint8_t&gt; quantized_boxes = xt::reshape_view(output_boxes, {num_proposals, 4, regression_length + 1});\r\n\r\n        auto shape = {quantized_boxes.shape(1), quantized_boxes.shape(2)};\r\n\r\n        \/\/ Keypoints setup\r\n        float32_t qp_scale_kpts = raw_keypoints[i]-&gt;vstream_info().quant_info.qp_scale;\r\n        float32_t qp_zp_kpts = raw_keypoints[i]-&gt;vstream_info().quant_info.qp_zp;\r\n\r\n        auto output_keypoints = common::get_xtensor(raw_keypoints[i]);        \r\n        int num_proposals_keypoints = output_keypoints.shape(0) * output_keypoints.shape(1);\r\n        auto output_keypoints_quantized = xt::view(output_keypoints, xt::all(), xt::all(), xt::all());\r\n        xt::xarray&lt;uint8_t&gt; quantized_keypoints = xt::reshape_view(output_keypoints_quantized, {num_proposals_keypoints, 17, 3});\r\n\r\n        auto keypoints_shape = {quantized_keypoints.shape(1), quantized_keypoints.shape(2)};<\/code><\/pre>\n<p>c. \u5176\u4ed6\u7684\u53cd\u91cf\u5316\u4e4b\u7c7b\u7684\u8017\u65f6\u4e5f\u4e0d\u5c11\u3002<\/p>\n<p>\u800c\u540c\u6837\u7684\u4ee3\u7801\u4f7f\u7528gihub\u7684demo\u76f4\u63a5\u5728RK3588\u4e0a\u9762\u7f16\u8bd1\u5374\u53ea\u6709\u7b2c\u4e00\u6b21\u9700\u898150ms\uff0c\u540e\u7eed\u53ea\u9700\u89815ms\u5de6\u53f3\u7684\u65f6\u95f4\u3002<\/p>\n<p>\u9488\u5bf9a\uff0c\u6211\u6ce8\u610f\u5230\u6b64\u90e8\u5206\u5728\u6bcf\u5e27\u8c03\u7528\u7684\u65f6\u5019\u4f1a\u5f97\u5230\u4e00\u6837\u7684\u7ed3\u679c\uff0c\u6211\u5c06\u6b64\u4ee3\u7801\u7247\u6bb5\u632a\u5230\u521d\u59cb\u5316\u5904\uff0c\u7136\u540e\u4f20\u53c2centers \u5230\u8fd9\u4e2a\u51fd\u6570\uff0c\u8282\u7ea6\u5904\u7406\u65f6\u95f4\u3002<\/p>\n<p>\u4f46\u662f\u5176\u4ed6\u90e8\u5206\u5b8c\u5168\u6ca1\u6709\u53d1\u73b0\u4efb\u4f55\u5f02\u5e38\u7684\u5730\u65b9\uff0c\u8d77\u521d\u6211\u6709\u6000\u7591\u5230\uff0c\u540e\u5904\u7406\u8fd0\u884c\u5728CPU\u7684\u5927\u6838\u5c0f\u6838\u539f\u56e0\uff0c\u4ee3\u7801\u7247\u6bb5\u5728\u6211\u8fd9\u8fb9\u8fdb\u884c\u6570\u636e\u62f7\u8d1d\u539f\u56e0\uff0c\u4e5f\u5c1d\u8bd5\u5c06\u6574\u4e2a\u540e\u5904\u7406\u53e6\u5916\u5f00\u7ebf\u7a0b\u8fdb\u884c\u5355\u72ec\u8fd0\u7b97\uff0c\u90fd\u672a\u80fd\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<p>\u540e\u9762\u4e3b\u8981\u6ce8\u610f\u5230Boxes\/keypoints setup \u65f6\u95f4\u57283\u6b21\u4e0d\u540csize\u60c5\u51b5\u4e0b\u7684\u5de8\u5927\u5dee\u5f02\uff0c\u901a\u8fc7\u67e5\u8be2\u8d44\u6599\uff0c\u53d1\u73b0\u4e3b\u8981\u539f\u56e0\u662f\u6211\u7684rockit demo\u5728\u4ee3\u7801\u7f16\u8bd1\u7684\u65f6\u5019\u6ca1\u6709\u4f7f\u7528 -03 gcc\u7684\u4ee3\u7801\u4f18\u5316\u7f16\u8bd1\u3002<\/p>\n<p>\u53ea\u9700\u8981\u5728CMakeList.txt\u4e2d\u589e\u52a0\u4e00\u884c<\/p>\n<pre><code>set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -O3\")<\/code><\/pre>\n<p>\u5c31\u53ef\u4ee5\u89e3\u51b3\u6b64\u95ee\u9898\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u6709\u5c1d\u8bd5\u5c06github\u4e2dyolov8-pose\u7684C++\u4ee3\u7801\u6574\u5408\u8fdb\u5165rockit demo\uff0c\u65b9\u4fbfrockit  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[15,1],"tags":[],"class_list":["post-701","post","type-post","status-publish","format-standard","hentry","category-ai","category-tech"],"_links":{"self":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/comments?post=701"}],"version-history":[{"count":2,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/701\/revisions"}],"predecessor-version":[{"id":703,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/posts\/701\/revisions\/703"}],"wp:attachment":[{"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/media?parent=701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/categories?post=701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhoubin.asia\/index.php\/wp-json\/wp\/v2\/tags?post=701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}