When giving two boundary maps to hg.match_pixels_image_2d, but there are no boundaries that match, the function hg.cpp._get_bipartite_matching_graph_contour_image_2d (used inside the code of hg.match_pixels_image_2d) basically returns that nothing matched, notably with an empty weights on which a np.max operation is performed afterwards, causing the following error:
line 46, in dummy_function
sources, targets = hg.match_pixels_image_2d(ucm_th, bmap, max_distance=params["max_dist"])
line 345, in match_pixels_match
matched_edges = hg.bipartite_graph_matching((sources, targets, num_nodes1 + num_nodes2), (weights * 1000).astype(np.int64))
line 144, in bipartite_graph_matching
very_large_weight = np.max(edge_weights) * 1000
line 2705, in amax
return _wrapreduction(a, np.maximum, 'max', axis, None, out,
line 87, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity
When giving two boundary maps to
hg.match_pixels_image_2d
, but there are no boundaries that match, the functionhg.cpp._get_bipartite_matching_graph_contour_image_2d
(used inside the code ofhg.match_pixels_image_2d
) basically returns that nothing matched, notably with an emptyweights
on which anp.max
operation is performed afterwards, causing the following error: