Commit fae17cd6 authored by Evin Dunn's avatar Evin Dunn
Browse files

cpu_matcher and cuda_matcher reset the Edge.masks df to empty

parent 0a2eb894
Loading
Loading
Loading
Loading
+8 −14
Original line number Diff line number Diff line
@@ -78,24 +78,18 @@ def match(edge, k=2, **kwargs):

    fl = FlannMatcher()

    # Get the correct descriptors
    # TODO: Extract into a helper function
    if 'aidx' in kwargs.keys():
        aidx = kwargs['aidx']
        kwargs.pop('aidx')
    else:
        aidx = None
    # Reset the edge.masks attrib; New matches would mean masks have to be
    # re-calculated
    edge.masks = pd.DataFrame()
    
    if 'bidx' in kwargs.keys():
        bidx = kwargs['bidx']
        kwargs.pop('bidx')
    else:
        bidx = None
    # Get the correct descriptors
    aidx = kwargs.pop('aidx', None)
    bidx = kwargs.pop('bidx', None)

    mono_matches(edge.source, edge.destination, aidx=aidx, bidx=bidx, **kwargs)
    mono_matches(edge.source, edge.destination, aidx=aidx, bidx=bidx)
    # Swap the indices since mono_matches is generic and source/destin are
    # swapped
    mono_matches(edge.destination, edge.source, aidx=bidx, bidx=aidx, **kwargs)
    mono_matches(edge.destination, edge.source, aidx=bidx, bidx=aidx)
    edge.matches.sort_values(by=['distance'])


+1 −0
Original line number Diff line number Diff line
@@ -38,4 +38,5 @@ def match(edge, ratio=0.8, **kwargs):

    # Set the matches and set the 'ratio' (ambiguity) mask
    edge.matches = df
    edge.masks = pd.DataFrame()
    edge.masks['ratio'] = df['ambiguity'] <= ratio