@@ -390,6 +390,8 @@ def init_writers(self):
390390 # Merged fragments writer
391391 if self .save_merges :
392392 zip_path = os .path .join (self .output_dir , "merged_fragments.zip" )
393+ if os .path .exists (zip_path ):
394+ os .remove (zip_path )
393395 self .merge_writer = ZipFile (zip_path , "a" )
394396
395397 # -- Main Routine --
@@ -601,7 +603,7 @@ def find_merge_site(self, key, kdtree, fragment_graph, source, visited):
601603 visited .add (node )
602604 voxel = fragment_graph .voxels [node ]
603605 gt_voxel = util .kdtree_query (kdtree , voxel )
604- if self .physical_dist (gt_voxel , voxel ) < 3 :
606+ if self .physical_dist (gt_voxel , voxel ) < 3.5 :
605607 # Local search
606608 node = self .branch_search (fragment_graph , kdtree , node )
607609 voxel = fragment_graph .voxels [node ]
@@ -617,7 +619,7 @@ def find_merge_site(self, key, kdtree, fragment_graph, source, visited):
617619 "Segment_ID" : segment_id ,
618620 "GroundTruth_ID" : key ,
619621 "Voxel" : tuple ([int (t ) for t in voxel ]),
620- "World" : tuple ([float (t ) for t in xyz ]),
622+ "World" : tuple ([float (round ( t , 2 ) ) for t in xyz ]),
621623 }
622624 )
623625
@@ -661,7 +663,7 @@ def process_merge_sites(self):
661663 # Remove duplicates
662664 idxs = set ()
663665 pts = [s ["World" ] for s in self .merge_sites ]
664- for idx_1 , idx_2 in KDTree (pts ).query_pairs (30 ):
666+ for idx_1 , idx_2 in KDTree (pts ).query_pairs (40 ):
665667 idxs .add (idx_1 )
666668 self .merge_sites = pd .DataFrame (self .merge_sites ).drop (idxs )
667669
@@ -850,7 +852,7 @@ def compute_weighted_avg(self, column_name):
850852 return (self .metrics [column_name ] * wgt ).sum () / wgt .sum ()
851853
852854 # -- Helpers --
853- def branch_search (self , graph , kdtree , root , radius = 70 ):
855+ def branch_search (self , graph , kdtree , root , radius = 100 ):
854856 """
855857 Searches for a branching node within distance "radius" from the given
856858 root node.
@@ -864,7 +866,7 @@ def branch_search(self, graph, kdtree, root, radius=70):
864866 root : int
865867 Root of search.
866868 radius : float, optional
867- Distance to search from root. The default is 70 .
869+ Distance to search from root. The default is 100 .
868870
869871 Returns
870872 -------
0 commit comments