@@ -271,7 +271,7 @@ def reassign_floating_island(mesh, info_on_pix, image, depth):
271
271
_ , label_lost_map = cv2 .connectedComponents (lost_map .astype (np .uint8 ), connectivity = 4 )
272
272
mask = np .zeros ((H , W ))
273
273
mask [bord_up :bord_down , bord_left :bord_right ] = 1
274
- label_lost_map = (label_lost_map * mask ).astype (np . int )
274
+ label_lost_map = (label_lost_map * mask ).astype (int )
275
275
276
276
for i in range (1 , label_lost_map .max ()+ 1 ):
277
277
lost_xs , lost_ys = np .where (label_lost_map == i )
@@ -966,8 +966,8 @@ def context_and_holes(mesh, edge_ccs, config, specific_edge_id, specific_edge_lo
966
966
mask_ccs = copy .deepcopy (edge_ccs )
967
967
forbidden_len = 3
968
968
forbidden_map = np .ones ((mesh .graph ['H' ] - forbidden_len , mesh .graph ['W' ] - forbidden_len ))
969
- forbidden_map = np .pad (forbidden_map , ((forbidden_len , forbidden_len ), (forbidden_len , forbidden_len )), mode = 'constant' ).astype (np . bool )
970
- cur_tmp_mask_map = np .zeros_like (forbidden_map ).astype (np . bool )
969
+ forbidden_map = np .pad (forbidden_map , ((forbidden_len , forbidden_len ), (forbidden_len , forbidden_len )), mode = 'constant' ).astype (bool )
970
+ cur_tmp_mask_map = np .zeros_like (forbidden_map ).astype (bool )
971
971
#passive_background = 10 if 10 is not None else background_thickness
972
972
#passive_context = 1 if 1 is not None else context_thickness
973
973
passive_background = 10 #if 10 is not None else background_thickness
@@ -988,7 +988,7 @@ def context_and_holes(mesh, edge_ccs, config, specific_edge_id, specific_edge_lo
988
988
tmp_mask_nodes = copy .deepcopy (mask_ccs [edge_id ])
989
989
tmp_intersect_nodes = []
990
990
tmp_intersect_context_nodes = []
991
- mask_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = np . bool )
991
+ mask_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = bool )
992
992
context_depth = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]))
993
993
comp_cnt_depth = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]))
994
994
connect_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]))
@@ -1015,7 +1015,7 @@ def context_and_holes(mesh, edge_ccs, config, specific_edge_id, specific_edge_lo
1015
1015
connect_map [xx [0 ], xx [1 ]] = xx [2 ]
1016
1016
tmp_context_nodes = [* context_ccs [edge_id ]]
1017
1017
tmp_erode .append ([* context_ccs [edge_id ]])
1018
- context_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = np . bool )
1018
+ context_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = bool )
1019
1019
if (context_map .astype (np .uint8 ) * mask_map .astype (np .uint8 )).max () > 0 :
1020
1020
import pdb ; pdb .set_trace ()
1021
1021
for node in tmp_context_nodes :
@@ -1025,14 +1025,14 @@ def context_and_holes(mesh, edge_ccs, config, specific_edge_id, specific_edge_lo
1025
1025
if (context_map .astype (np .uint8 ) * mask_map .astype (np .uint8 )).max () > 0 :
1026
1026
import pdb ; pdb .set_trace ()
1027
1027
tmp_intouched_nodes = [* intouched_ccs [edge_id ]]
1028
- intouched_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = np . bool )
1028
+ intouched_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = bool )
1029
1029
for node in tmp_intouched_nodes : intouched_map [node [0 ], node [1 ]] = True
1030
1030
intouched_map [mask_map == True ] = False
1031
1031
tmp_redundant_nodes = set ()
1032
1032
tmp_noncont_nodes = set ()
1033
- noncont_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = np . bool )
1034
- intersect_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = np . bool )
1035
- intersect_context_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = np . bool )
1033
+ noncont_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = bool )
1034
+ intersect_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = bool )
1035
+ intersect_context_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ]), dtype = bool )
1036
1036
if i > passive_background and inpaint_iter == 0 :
1037
1037
new_tmp_intersect_nodes = None
1038
1038
new_tmp_intersect_nodes = []
@@ -1311,9 +1311,9 @@ def context_and_holes(mesh, edge_ccs, config, specific_edge_id, specific_edge_lo
1311
1311
tmp_context_nodes = copy .deepcopy (ecnt_cc )
1312
1312
tmp_invalid_context_nodes = copy .deepcopy (invalid_extend_edge_ccs [ecnt_id ])
1313
1313
tmp_mask_nodes = copy .deepcopy (accomp_extend_context_ccs [ecnt_id ])
1314
- tmp_context_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ])).astype (np . bool )
1315
- tmp_mask_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ])).astype (np . bool )
1316
- tmp_invalid_context_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ])).astype (np . bool )
1314
+ tmp_context_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ])).astype (bool )
1315
+ tmp_mask_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ])).astype (bool )
1316
+ tmp_invalid_context_map = np .zeros ((mesh .graph ['H' ], mesh .graph ['W' ])).astype (bool )
1317
1317
for node in tmp_mask_nodes :
1318
1318
tmp_mask_map [node [0 ], node [1 ]] = True
1319
1319
for node in context_ccs [ecnt_id ]:
0 commit comments