Loading autocnet/graph/network.py +5 −1 Original line number Diff line number Diff line Loading @@ -9,11 +9,11 @@ import pandas as pd from autocnet.control.control import C from autocnet.fileio import io_json from autocnet.matcher.matcher import FlannMatcher import autocnet.matcher.suppression_funcs as spf from autocnet.graph.edge import Edge from autocnet.graph.node import Node from autocnet.vis.graph_view import plot_graph class CandidateGraph(nx.Graph): """ A NetworkX derived directed graph to store candidate overlap images. Loading Loading @@ -318,6 +318,10 @@ class CandidateGraph(nx.Graph): upsampling=upsampling, template_size=template_size, search_size=search_size, tiled=tiled) def suppress(self, clean_keys=[], func=spf.correlation, **kwargs): for s, d, e in self.edges_iter(data=True): e.suppress(clean_keys=clean_keys, func=func, **kwargs) def to_filelist(self): """ Generate a file list for the entire graph. Loading autocnet/matcher/tests/test_matcher.py +5 −4 Original line number Diff line number Diff line import os import sys import unittest import warnings import cv2 import numpy as np sys.path.append(os.path.abspath('..')) Loading Loading @@ -33,9 +33,10 @@ class TestMatcher(unittest.TestCase): fmatcher.train() self.assertRaises(ValueError, fmatcher.query,self.fd['AS15-M-0296_SML.png'][1],0, k=2 ) matches = fmatcher.query(self.fd['AS15-M-0297_SML.png'][1], 1, k=2) self.assertEqual(len(matches), 20) with warnings.catch_warnings(record=True) as w: fmatcher.query(self.fd['AS15-M-0296_SML.png'][1],0, k=2) self.assertEqual(len(w), 1) self.assertEqual(w[0].category, UserWarning) def tearDown(self): pass Loading Loading
autocnet/graph/network.py +5 −1 Original line number Diff line number Diff line Loading @@ -9,11 +9,11 @@ import pandas as pd from autocnet.control.control import C from autocnet.fileio import io_json from autocnet.matcher.matcher import FlannMatcher import autocnet.matcher.suppression_funcs as spf from autocnet.graph.edge import Edge from autocnet.graph.node import Node from autocnet.vis.graph_view import plot_graph class CandidateGraph(nx.Graph): """ A NetworkX derived directed graph to store candidate overlap images. Loading Loading @@ -318,6 +318,10 @@ class CandidateGraph(nx.Graph): upsampling=upsampling, template_size=template_size, search_size=search_size, tiled=tiled) def suppress(self, clean_keys=[], func=spf.correlation, **kwargs): for s, d, e in self.edges_iter(data=True): e.suppress(clean_keys=clean_keys, func=func, **kwargs) def to_filelist(self): """ Generate a file list for the entire graph. Loading
autocnet/matcher/tests/test_matcher.py +5 −4 Original line number Diff line number Diff line import os import sys import unittest import warnings import cv2 import numpy as np sys.path.append(os.path.abspath('..')) Loading Loading @@ -33,9 +33,10 @@ class TestMatcher(unittest.TestCase): fmatcher.train() self.assertRaises(ValueError, fmatcher.query,self.fd['AS15-M-0296_SML.png'][1],0, k=2 ) matches = fmatcher.query(self.fd['AS15-M-0297_SML.png'][1], 1, k=2) self.assertEqual(len(matches), 20) with warnings.catch_warnings(record=True) as w: fmatcher.query(self.fd['AS15-M-0296_SML.png'][1],0, k=2) self.assertEqual(len(w), 1) self.assertEqual(w[0].category, UserWarning) def tearDown(self): pass Loading