Skip to content

Commit

Permalink
Move off of old demodata
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Apr 14, 2024
1 parent e6a44ef commit 1a12096
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 1,575 deletions.
1,413 changes: 0 additions & 1,413 deletions dev/broken/_dep_matching.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_spatial_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_dummy_test_vars():
return chip1, chip2, kpts1, kpts2, fm


def get_dummy_test_vars1(fname1='easy1.png', fname2='easy2.png'):
def get_dummy_test_vars1(fname1='tsukuba_r', fname2='tsukuba_l'):
import utool as ut
from vtool_ibeis import image as gtool
from vtool_ibeis import features as feattool
Expand Down
129 changes: 0 additions & 129 deletions tests/test_sver_wrapper.py

This file was deleted.

4 changes: 2 additions & 2 deletions vtool_ibeis/coverage_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def make_grid_coverage_mask(kpts, chipsize, weights, pxl_per_bin=4,
>>> from vtool_ibeis.coverage_grid import * # NOQA
>>> import vtool_ibeis as vt
>>> # build test data
>>> kpts, chipsize, weights = coverage_kpts.testdata_coverage('easy1.png')
>>> kpts, chipsize, weights = coverage_kpts.testdata_coverage('tsukuba_l')
>>> pxl_per_bin = 4
>>> grid_steps = 2
>>> # execute function
Expand Down Expand Up @@ -323,7 +323,7 @@ def gridsearch_coverage_grid_mask():
"""
import plottool_ibeis as pt
cfgdict_list, cfglbl_list = get_coverage_grid_gridsearch_configs()
kpts, chipsize, weights = coverage_kpts.testdata_coverage('easy1.png')
kpts, chipsize, weights = coverage_kpts.testdata_coverage('astro')
gridmask_list = [
255 * make_grid_coverage_mask(kpts, chipsize, weights, **cfgdict)
for cfgdict in ub.ProgIter(cfgdict_list, desc='coverage grid')
Expand Down
27 changes: 14 additions & 13 deletions vtool_ibeis/coverage_kpts.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ def gridsearch_kpts_coverage_mask():
"""
import plottool_ibeis as pt
cfgdict_list, cfglbl_list = get_coverage_kpts_gridsearch_configs()
kpts, chipsize, weights = testdata_coverage('easy1.png')
# kpts, chipsize, weights = testdata_coverage('easy1.png')
kpts, chipsize, weights = testdata_coverage('astro')
imgmask_list = [
255 * make_kpts_coverage_mask(kpts, chipsize, weights,
return_patch=False, **cfgdict)
Expand All @@ -459,18 +460,18 @@ def testdata_coverage(fname=None):
# build test data
kpts, vecs = vt.demodata.get_testdata_kpts(fname, with_vecs=True)
# HACK IN DISTINCTIVENESS
if fname is not None:
from ibeis.algo.hots import distinctiveness_normalizer
cachedir = ub.ensure_app_cache_dir('ibeis', 'distinctiveness_model')
species = 'zebra_plains'
dstcnvs_normer = distinctiveness_normalizer.DistinctivnessNormalizer(species, cachedir=cachedir)
dstcnvs_normer.load(cachedir)
weights = dstcnvs_normer.get_distinctiveness(vecs)
else:
kpts = np.vstack((kpts, [0, 0, 1, 1, 1, 0]))
kpts = np.vstack((kpts, [0.01, 10, 1, 1, 1, 0]))
kpts = np.vstack((kpts, [0.94, 11.5, 1, 1, 1, 0]))
weights = np.ones(len(kpts))
# if fname is not None:
# from ibeis.algo.hots import distinctiveness_normalizer
# cachedir = ub.ensure_app_cache_dir('ibeis', 'distinctiveness_model')
# species = 'zebra_plains'
# dstcnvs_normer = distinctiveness_normalizer.DistinctivnessNormalizer(species, cachedir=cachedir)
# dstcnvs_normer.load(cachedir)
# weights = dstcnvs_normer.get_distinctiveness(vecs)
# else:
kpts = np.vstack((kpts, [0, 0, 1, 1, 1, 0]))
kpts = np.vstack((kpts, [0.01, 10, 1, 1, 1, 0]))
kpts = np.vstack((kpts, [0.94, 11.5, 1, 1, 1, 0]))
weights = np.ones(len(kpts))
chipsize = tuple(vt.iceil(vt.get_kpts_image_extent(kpts)[2:4]).tolist())
return kpts, chipsize, weights

Expand Down
6 changes: 3 additions & 3 deletions vtool_ibeis/demodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def get_testdata_kpts(fname=None, with_vecs=False):
return kpts


def testdata_ratio_matches(fname1='easy1.png', fname2='easy2.png', **kwargs):
def testdata_ratio_matches(fname1='tsukuba_r', fname2='tsukuba_l', **kwargs):
r"""
Runs simple ratio-test matching between two images.
Technically this is not demodata data.
Expand All @@ -659,8 +659,8 @@ def testdata_ratio_matches(fname1='easy1.png', fname2='easy2.png', **kwargs):
>>> # xdoctest: +REQUIRES(module:pyhesaff)
>>> from vtool_ibeis.demodata import * # NOQA
>>> import vtool_ibeis as vt
>>> fname1 = ut.get_argval('--fname1', type_=str, default='easy1.png')
>>> fname2 = ut.get_argval('--fname2', type_=str, default='easy2.png')
>>> fname1 = ut.get_argval('--fname1', type_=str, default='tsukuba_l')
>>> fname2 = ut.get_argval('--fname2', type_=str, default='tsukuba_r')
>>> default_dict = vt.get_extract_features_default_params()
>>> default_dict['ratio_thresh'] = .625
>>> kwargs = ut.argparse_dict(default_dict)
Expand Down
4 changes: 2 additions & 2 deletions vtool_ibeis/inspect_matches.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class MatchInspector(INSPECT_BASE):
>>> import vtool_ibeis as vt
>>> gt.ensure_qapp()
>>> ut.qtensure()
>>> annot1 = lazy_test_annot('easy1.png')
>>> annot2 = lazy_test_annot('easy2.png')
>>> annot1 = lazy_test_annot('tsukuba_r')
>>> annot2 = lazy_test_annot('tsukuba_l')
>>> match = vt.PairwiseMatch(annot1, annot2)
>>> self = MatchInspector(match=match)
>>> self.show()
Expand Down
16 changes: 9 additions & 7 deletions vtool_ibeis/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def demodata_match(cfgdict={}, apply=True, use_cache=True, recompute=False):
enabled=use_cache
)
match = cacher.tryload()
annot1 = lazy_test_annot('easy1.png')
annot2 = lazy_test_annot('easy2.png')
annot1 = lazy_test_annot('tsukuba_l')
annot2 = lazy_test_annot('tsukuba_r')
if match is None or recompute:
match = vt.PairwiseMatch(annot1, annot2)
if apply:
Expand Down Expand Up @@ -141,8 +141,10 @@ class PairwiseMatch(ub.NiceRepr):
>>> # xdoctest: +REQUIRES(module:pyhesaff)
>>> from vtool_ibeis.matching import * # NOQA
>>> import vtool_ibeis as vt
>>> imgR = vt.imread(ut.grab_test_imgpath('easy1.png'))
>>> imgL = vt.imread(ut.grab_test_imgpath('easy2.png'))
>>> #imgR = vt.imread(ut.grab_test_imgpath('easy1.png'))
>>> #imgL = vt.imread(ut.grab_test_imgpath('easy2.png'))
>>> imgR = vt.imread(ut.grab_test_imgpath('tsukuba_r'))
>>> imgL = vt.imread(ut.grab_test_imgpath('tsukuba_l'))
>>> annot1 = {'rchip': imgR}
>>> annot2 = {'rchip': imgL}
>>> match = vt.PairwiseMatch(annot1, annot2)
Expand All @@ -162,8 +164,8 @@ class PairwiseMatch(ub.NiceRepr):
>>> match.ishow()
>>> from vtool_ibeis.matching import * # NOQA
>>> import vtool_ibeis as vt
>>> imgR = vt.imread(ut.grab_test_imgpath('easy1.png'))
>>> imgL = vt.imread(ut.grab_test_imgpath('easy2.png'))
>>> imgR = vt.imread(ut.grab_test_imgpath('tsukuba_r'))
>>> imgL = vt.imread(ut.grab_test_imgpath('tsukuba_l'))
>>> annot1 = {'rchip': imgR}
>>> annot2 = {'rchip': imgL}
>>> match = vt.PairwiseMatch(annot1, annot2)
Expand Down Expand Up @@ -1449,7 +1451,7 @@ def ensure_metadata_feats(annot, cfgdict={}):
>>> # ENABLE_DOCTEST
>>> # xdoctest: +REQUIRES(module:pyhesaff)
>>> from vtool_ibeis.matching import * # NOQA
>>> rchip_fpath = ut.grab_test_imgpath('easy1.png')
>>> rchip_fpath = ut.grab_test_imgpath('astro')
>>> annot = ut.LazyDict({'rchip_fpath': rchip_fpath})
>>> cfgdict = {}
>>> ensure_metadata_feats(annot, cfgdict)
Expand Down
6 changes: 4 additions & 2 deletions vtool_ibeis/nearest_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ def test_cv2_flann():
from vtool_ibeis import demodata
import plottool_ibeis as pt
import vtool_ibeis as vt
img1 = vt.imread(ut.grab_test_imgpath('easy1.png'))
img2 = vt.imread(ut.grab_test_imgpath('easy2.png'))
# img1 = vt.imread(ut.grab_test_imgpath('easy1.png'))
# img2 = vt.imread(ut.grab_test_imgpath('easy2.png'))
img1 = vt.imread(ut.grab_test_imgpath('tsukuba_l'))
img2 = vt.imread(ut.grab_test_imgpath('tsukuba_r'))

stereo = cv2.StereoBM_create(numDisparities=16, blockSize=15)
disparity = stereo.compute(img1, img2)
Expand Down
2 changes: 1 addition & 1 deletion vtool_ibeis/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def demo_grabcut(bgr_img):
>>> import utool as ut
>>> import plottool_ibeis as pt
>>> import vtool_ibeis as vt
>>> img_fpath = ut.grab_test_imgpath('easy1.png')
>>> img_fpath = ut.grab_test_imgpath('astro')
>>> bgr_img = vt.imread(img_fpath)
>>> # execute function
>>> print(bgr_img.shape)
Expand Down
4 changes: 2 additions & 2 deletions vtool_ibeis/spatial_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ def testdata_matching_affine_inliers():
ori_thresh = 1.57
xy_thresh_sqrd = dlen_sqrd2 * xy_thresh
featkw = ut.argparse_dict(vt.get_extract_features_default_params())
fname1 = ut.get_argval('--fname1', type_=str, default='easy1.png')
fname2 = ut.get_argval('--fname2', type_=str, default='easy2.png')
fname1 = ut.get_argval('--fname1', type_=str, default='tsukuba_l')
fname2 = ut.get_argval('--fname2', type_=str, default='tsukuba_r')
(kpts1, kpts2, fm, fs, rchip1, rchip2) = demodata.testdata_ratio_matches(fname1, fname2, **featkw)
aff_inliers, aff_errors, Aff = get_best_affine_inliers_(
kpts1, kpts2, fm, fs, xy_thresh_sqrd, scale_thresh, ori_thresh)
Expand Down

0 comments on commit 1a12096

Please sign in to comment.