{"id":36,"date":"2021-10-26T02:40:19","date_gmt":"2021-10-25T18:40:19","guid":{"rendered":"https:\/\/dcupqiu.club\/?p=36"},"modified":"2022-02-20T19:16:01","modified_gmt":"2022-02-20T11:16:01","slug":"centernet-headerbu-fen-can-kao","status":"publish","type":"post","link":"https:\/\/dcupqiu.club\/?p=36","title":{"rendered":"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790"},"content":{"rendered":"<h2 id=\"voxelfeatureextractorv3\">VoxelFeatureExtractorV3<\/h2>\n<p>\u5728\u8be5\u7f51\u7edc\u4e2d\u7684VoxelFeatureExtractor\u662f\u5bf9Voxel\u4e2d\u7684\u70b9\u4e91feature\u4f5c\u5e73\u5747<\/p>\n<h2 id=\"backbone\">Backbone<\/h2>\n<p>File: det3d\/models\/backbones\/scn.py<\/p>\n<p>voxel_features: num x feature_dim<\/p>\n<p>coors: The dimention 1st is the index of batch<\/p>\n<p>batch_size: total_batch_size<\/p>\n<p>input_shape: [h, y, x]<\/p>\n<h2 id=\"rpn\">RPN<\/h2>\n<p>2\u4e2ablocks\uff0c2\u4e2adeblocks\uff0cblocks5\u5c42\u5377\u79ef\uff0cdeblocks1\u5c42\u53cd\u5377\u79ef\uff0c\u6700\u7ec8\u8f93\u51fafeature map size\u4e0d\u53d8\uff0c\u5176\u4ed6\u6ca1\u5565\u7279\u522b\u7684<\/p>\n<h2 id=\"centerhead\">CenterHead<\/h2>\n<p>\u53c2\u6570<\/p>\n<p><!--kg-card-begin: markdown--><\/p>\n<pre><code>bbox_head=dict(    type=&quot;CenterHead&quot;,\n    in_channels=sum([256, 256]),\n    tasks=tasks,\n    dataset='nuscenes',\n    weight=0.25,\n    code_weights=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.2, 0.2, 1.0, 1.0],\n    common_heads={'reg': (2, 2), 'height': (1, 2), 'dim':(3, 2), 'rot':(2, 2), 'vel': (2, 2)},\n    share_conv_channel=64,\n    dcn_head=False\n),\n<\/code><\/pre>\n<p><!--kg-card-end: markdown--><\/p>\n<p>\u81ea\u6709\u53c2\u6570\uff1a<\/p>\n<p>class_names: list[list[classes with task]]<\/p>\n<p>num_classes: list[int[class_num with task]]<\/p>\n<p>weight: weight between hm_loss and loc_loss<\/p>\n<p>code_weights: \u5176\u4ed6\u51e0\u4e2a\u635f\u5931\u7684\u6743\u91cd<\/p>\n<p>box_n_dim = 9 if &#8216;vel&#8217; in common_heads else 7<\/p>\n<p>shared_conv: \u5171\u4eab\u5c42<\/p>\n<p> tasks: nn.ModuleList[SepHead(shared_conv_channel, heads, bn=True, init_bias=-2.19, final_kernel = 3)]<\/p>\n<h4 id=\"forword\">Forword: &#8230;<\/h4>\n<h4 id=\"predict\">predict: &#8230;.<\/h4>\n<h2 id=\"sephead\">SepHead:<\/h2>\n<p>\u6ca1\u5565\u7279\u522b\u7684\uff0c\u5c31\u662f\u4e00\u4e2a\u5377\u79ef\u7f62\u4e86<\/p>\n<h2 id=\"centerheadloss\">CenterHead_loss<\/h2>\n<p>hm \u9700\u8981\u4f7f\u7528sigmoid\u6fc0\u6d3b\u51fd\u6570\u5e76\u4f5c\u9650\u5e45<\/p>\n<p>hm_loss = self.crit(preds_dict[&#8216;hm&#8217;], example[&#8216;hm&#8217;][task_id], example[&#8216;ind&#8217;][task_id], example[&#8216;mask&#8217;][task_id], example[&#8216;cat&#8217;][task_id])<\/p>\n<p>\u8ba1\u7b97\u65b9\u5f0f\uff0c\u91cd\u8981\uff0c\u7559\u4f5c\u53c2\u8003\uff1a<\/p>\n<p><!--kg-card-begin: markdown--><\/p>\n<pre><code>mask = mask.float() # cat \u548c ind \u6709\u6548\u4f4d\u7684mask\ngt = torch,pow(1-target , 4)\nneg_loss = torch.log(1 - out) * torch.pow(out, 2) * gt\nneg_loss = neg_loss.sum()\npos_pred_pix = _transpose_and_gather_feat(out, ind) # B x M x C\npos_pred = pos_pred_pix.gather(2, cat.unsqueeze(2)) # B x M\nnum_pos = mask.sum()\npos_loss = torch.log(pos_pred) * torch.pow(1 - pos_pred, 2) * mask.unsqueeze(2)\npos_loss = pos_loss.sum()\nif num_pose == 0:\n    return -neg_loss\nreturn - (pos_loss + neg_loss) \/ num_pos\n<\/code><\/pre>\n<p><!--kg-card-end: markdown--><\/p>\n<p>\u6ce8\u610f\uff0c\u9884\u6d4b\u7684rot\u662f2\u7ef4\u7684sin(rot)\u548ccos(rot)<\/p>\n<p><!--kg-card-begin: markdown--><\/p>\n<pre><code>box_loss = self.crit_reg(preds_dict['anno_box'], example['mask'][task_id], example['ind'][task_id], target_box)\nloc_loss = (box_loss*box_loss.new_tensor(self.code_weights)).sum()\n\\# crit_reg\u662f\u4e00\u4e2a\u57fa\u672c\u7684L1 loss\uff0c\u5982\u4e0b\uff1a\npred =  _transpose_and_gather_feat(output, ind)\nmask = mask.float().unsqueeze(2)\nloss = F.l1_loss(pred * mask, target*mask, reduction='none')\nloss = loss \/ (mask.sum() + 1e-4)\nloss = loss.transpose(2, 0).sun(dim=2).sum(dim=1)\n<\/code><\/pre>\n<p><!--kg-card-end: markdown--><\/p>\n<h2 id=\"predict%E5%89%8D%E5%90%91%E6%8E%A8%E7%90%86%E8%BF%87%E7%A8%8B\">Predict\u524d\u5411\u63a8\u7406\u8fc7\u7a0b<\/h2>\n<p><!--kg-card-begin: markdown--><\/p>\n<pre><code>test_cfg = dict(\n    post_center_limit_range=[-61.2, -61.2, -10.0, 61.2, 61.2, 10.0],\n    max_per_img=500,\n    nms=dict(\n        use_rotate_nms=True,\n        use_multi_class_nms=False,\n        nms_pre_max_size=1000,\n        nms_post_max_size=83,\n        nms_iou_threshold=0.2,\n    ),\n    score_threshold=0.1,\n    pc_range=[-54, -54],\n    out_size_factor=get_downsample_factor(model),\n    voxel_size=[0.075, 0.075]\n)\n<\/code><\/pre>\n<p><!--kg-card-end: markdown--><\/p>\n<p>\u6240\u4ee5post_center_limit_range\u662f\u5e72\u5565\u7684\uff1f\uff1f\uff1f\uff1f\u76f4\u63a5\u770b\u4ee3\u7801\u5427\uff0c\u7d2f\u4e86\uff0cdet3d\/models\/bbox_heads\/center_head.py-&gt;CenterHead:prediction<\/p>\n<h4 id=\"postprocess\">Post_process:<\/h4>\n<p>\u540e\u5904\u7406\u8fc7\u7a0b\uff0c\u4f3c\u4e4e\u662f\u4e00\u4e2a\u57fa\u4e8ecircle\u7684nms\uff0c\u53ef\u4ee5\u53c2\u8003<\/p>\n<h4 id=\"circle-nms\">Circle Nms:<\/h4>\n<p>det3d\/core\/utils\/circle_nms_jit.py <\/p>\n<p>\u5b9e\u73b0\u5f88\u7b80\u5355\uff0c\u968f\u4fbf\u770b\u770b\u5c31\u597d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VoxelFeatureExtractorV3 \u5728&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[5],"class_list":["post-36","post","type-post","status-publish","format-standard","hentry","category-code-memorandum","tag-leetcode"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.5.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790 - \u79cb\u5586\u306eSite<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dcupqiu.club\/?p=36\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790 - \u79cb\u5586\u306eSite\" \/>\n<meta property=\"og:description\" content=\"VoxelFeatureExtractorV3 \u5728...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dcupqiu.club\/?p=36\" \/>\n<meta property=\"og:site_name\" content=\"\u79cb\u5586\u306eSite\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-25T18:40:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-20T11:16:01+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79cb\u5586\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dcupqiu.club\/#website\",\"url\":\"https:\/\/dcupqiu.club\/\",\"name\":\"\u79cb\u5586\u306eSite\",\"description\":\"WwwwwW\",\"publisher\":{\"@id\":\"https:\/\/dcupqiu.club\/#\/schema\/person\/33f847360b49873a92e0a1461d4d6a20\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dcupqiu.club\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dcupqiu.club\/?p=36#webpage\",\"url\":\"https:\/\/dcupqiu.club\/?p=36\",\"name\":\"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790 - \u79cb\u5586\u306eSite\",\"isPartOf\":{\"@id\":\"https:\/\/dcupqiu.club\/#website\"},\"datePublished\":\"2021-10-25T18:40:19+00:00\",\"dateModified\":\"2022-02-20T11:16:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/dcupqiu.club\/?p=36#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dcupqiu.club\/?p=36\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dcupqiu.club\/?p=36#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/dcupqiu.club\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/dcupqiu.club\/?p=36#article\",\"isPartOf\":{\"@id\":\"https:\/\/dcupqiu.club\/?p=36#webpage\"},\"author\":{\"@id\":\"https:\/\/dcupqiu.club\/#\/schema\/person\/33f847360b49873a92e0a1461d4d6a20\"},\"headline\":\"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790\",\"datePublished\":\"2021-10-25T18:40:19+00:00\",\"dateModified\":\"2022-02-20T11:16:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dcupqiu.club\/?p=36#webpage\"},\"wordCount\":155,\"publisher\":{\"@id\":\"https:\/\/dcupqiu.club\/#\/schema\/person\/33f847360b49873a92e0a1461d4d6a20\"},\"keywords\":[\"Leetcode\"],\"articleSection\":[\"\u7a0b\u5e8f\u5907\u5fd8\u5f55\"],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/dcupqiu.club\/#\/schema\/person\/33f847360b49873a92e0a1461d4d6a20\",\"name\":\"\u79cb\u5586\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/dcupqiu.club\/#personlogo\",\"inLanguage\":\"zh-Hans\",\"url\":\"https:\/\/dcupqiu.club\/wp-content\/uploads\/\/2022\/04\/ww.png\",\"contentUrl\":\"https:\/\/dcupqiu.club\/wp-content\/uploads\/\/2022\/04\/ww.png\",\"width\":920,\"height\":700,\"caption\":\"\u79cb\u5586\"},\"logo\":{\"@id\":\"https:\/\/dcupqiu.club\/#personlogo\"},\"sameAs\":[\"http:\/\/dcupqiu.club\"],\"url\":\"https:\/\/dcupqiu.club\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790 - \u79cb\u5586\u306eSite","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dcupqiu.club\/?p=36","og_locale":"zh_CN","og_type":"article","og_title":"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790 - \u79cb\u5586\u306eSite","og_description":"VoxelFeatureExtractorV3 \u5728...","og_url":"https:\/\/dcupqiu.club\/?p=36","og_site_name":"\u79cb\u5586\u306eSite","article_published_time":"2021-10-25T18:40:19+00:00","article_modified_time":"2022-02-20T11:16:01+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79cb\u5586","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/dcupqiu.club\/#website","url":"https:\/\/dcupqiu.club\/","name":"\u79cb\u5586\u306eSite","description":"WwwwwW","publisher":{"@id":"https:\/\/dcupqiu.club\/#\/schema\/person\/33f847360b49873a92e0a1461d4d6a20"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dcupqiu.club\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"https:\/\/dcupqiu.club\/?p=36#webpage","url":"https:\/\/dcupqiu.club\/?p=36","name":"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790 - \u79cb\u5586\u306eSite","isPartOf":{"@id":"https:\/\/dcupqiu.club\/#website"},"datePublished":"2021-10-25T18:40:19+00:00","dateModified":"2022-02-20T11:16:01+00:00","breadcrumb":{"@id":"https:\/\/dcupqiu.club\/?p=36#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dcupqiu.club\/?p=36"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dcupqiu.club\/?p=36#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/dcupqiu.club\/"},{"@type":"ListItem","position":2,"name":"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790"}]},{"@type":"Article","@id":"https:\/\/dcupqiu.club\/?p=36#article","isPartOf":{"@id":"https:\/\/dcupqiu.club\/?p=36#webpage"},"author":{"@id":"https:\/\/dcupqiu.club\/#\/schema\/person\/33f847360b49873a92e0a1461d4d6a20"},"headline":"CenterPoint\u6a21\u578b\u90e8\u5206\u4ee3\u7801\u89e3\u6790","datePublished":"2021-10-25T18:40:19+00:00","dateModified":"2022-02-20T11:16:01+00:00","mainEntityOfPage":{"@id":"https:\/\/dcupqiu.club\/?p=36#webpage"},"wordCount":155,"publisher":{"@id":"https:\/\/dcupqiu.club\/#\/schema\/person\/33f847360b49873a92e0a1461d4d6a20"},"keywords":["Leetcode"],"articleSection":["\u7a0b\u5e8f\u5907\u5fd8\u5f55"],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/dcupqiu.club\/#\/schema\/person\/33f847360b49873a92e0a1461d4d6a20","name":"\u79cb\u5586","image":{"@type":"ImageObject","@id":"https:\/\/dcupqiu.club\/#personlogo","inLanguage":"zh-Hans","url":"https:\/\/dcupqiu.club\/wp-content\/uploads\/\/2022\/04\/ww.png","contentUrl":"https:\/\/dcupqiu.club\/wp-content\/uploads\/\/2022\/04\/ww.png","width":920,"height":700,"caption":"\u79cb\u5586"},"logo":{"@id":"https:\/\/dcupqiu.club\/#personlogo"},"sameAs":["http:\/\/dcupqiu.club"],"url":"https:\/\/dcupqiu.club\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/dcupqiu.club\/index.php?rest_route=\/wp\/v2\/posts\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dcupqiu.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dcupqiu.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dcupqiu.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dcupqiu.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=36"}],"version-history":[{"count":1,"href":"https:\/\/dcupqiu.club\/index.php?rest_route=\/wp\/v2\/posts\/36\/revisions"}],"predecessor-version":[{"id":62,"href":"https:\/\/dcupqiu.club\/index.php?rest_route=\/wp\/v2\/posts\/36\/revisions\/62"}],"wp:attachment":[{"href":"https:\/\/dcupqiu.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dcupqiu.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dcupqiu.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}