From bdfd76a72d196d8ecaa90bb5787086498a12f0f6 Mon Sep 17 00:00:00 2001 From: Christian Kanesan Date: Fri, 7 Jan 2022 15:27:49 +0100 Subject: [PATCH] Minor fixes --- hawp/detector.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hawp/detector.py b/hawp/detector.py index 55fa2a4..5843bdc 100644 --- a/hawp/detector.py +++ b/hawp/detector.py @@ -117,11 +117,8 @@ def forward(self, images, annotations = None): else: lines_pred = self.proposal_lines_new(md_pred[0], dis_pred[0], None).view(-1, 4) - #jloc_pred_nms = non_maximum_suppression(jloc_pred[0]) - #topK = torch.clamp((jloc_pred_nms > 0.008).count_nonzero(), max=300) - nms_jloc_pred = non_maximum_suppression(jloc_pred)[0] - juncs_pred, _ = get_junctions(nms_jloc_pred,joff_pred[0], topk=300, th=0.008) + juncs_pred, _ = get_junctions(nms_jloc_pred, joff_pred[0], topk=300, th=0.008) extra_info['time_proposal'] = time.time() - extra_info['time_proposal'] extra_info['time_matching'] = time.time() dis_junc_to_end1, idx_junc_to_end1 = torch.sum((lines_pred[:,:2]-juncs_pred[:,None])**2,dim=-1).min(0) @@ -196,7 +193,7 @@ def proposal_lines(self, md_maps, dis_maps, scale=5.0): cs_ed = torch.cos(ed_).clamp(min=1e-3) ss_ed = torch.sin(ed_).clamp(max=-1e-3) - x_standard = torch.ones_like(cs_st) + #x_standard = torch.ones_like(cs_st) y_st = ss_st/cs_st y_ed = ss_ed/cs_ed