Denys Rozumnyi commited on
Commit
5f76e47
·
1 Parent(s): b130371
Files changed (2) hide show
  1. geom_solver.py +7 -2
  2. testing.ipynb +0 -0
geom_solver.py CHANGED
@@ -16,7 +16,7 @@ def my_empty_solution():
16
  class GeomSolver(object):
17
 
18
  def __init__(self):
19
- self.min_vertices = 18
20
  self.kmeans_th = 130
21
  self.point_dist_th = 60
22
  self.th_min_support = 3
@@ -24,6 +24,7 @@ class GeomSolver(object):
24
  self.device = 'cuda:0'
25
  self.return_edges = False
26
  self.mean_fixed = False
 
27
 
28
  def cluster_points(self, point_types):
29
  point_colors = []
@@ -138,11 +139,15 @@ class GeomSolver(object):
138
  self.wf_center[-1] = centers[:, -1].mean()
139
 
140
  self.vertices = centers
 
141
  if self.broken_cams.any():
142
  vertices = centers
143
  print("There are broken cams.")
 
 
 
144
  else:
145
- nvert = centers.shape[0]
146
  if self.mean_fixed:
147
  added_one = (self.min_vertices * self.wf_center - self.vertices.sum(0)) / (self.min_vertices - nvert)
148
  else:
 
16
  class GeomSolver(object):
17
 
18
  def __init__(self):
19
+ self.min_vertices = 2
20
  self.kmeans_th = 130
21
  self.point_dist_th = 60
22
  self.th_min_support = 3
 
24
  self.device = 'cuda:0'
25
  self.return_edges = False
26
  self.mean_fixed = False
27
+ self.repeat_predicted = True
28
 
29
  def cluster_points(self, point_types):
30
  point_colors = []
 
139
  self.wf_center[-1] = centers[:, -1].mean()
140
 
141
  self.vertices = centers
142
+ nvert = centers.shape[0]
143
  if self.broken_cams.any():
144
  vertices = centers
145
  print("There are broken cams.")
146
+ elif nvert >= self.min_vertices:
147
+ vertices = centers
148
+ print("Enough vertices.")
149
  else:
150
+ # if self.repeat_predicted:
151
  if self.mean_fixed:
152
  added_one = (self.min_vertices * self.wf_center - self.vertices.sum(0)) / (self.min_vertices - nvert)
153
  else:
testing.ipynb CHANGED
The diff for this file is too large to render. See raw diff