def test_viz_image(imgpaths): nImgs = len(imgpaths) assert len(imgpaths) < 20, '%d > 20 out of scope of this test' % nImgs tau = np.pi * 2 fnum = 1 img_list = imread_many(imgpaths) nRows, nCols = ph.get_square_row_cols(nImgs) print('[viz*] r=%r, c=%r' % (nRows, nCols)) #gs2 = gridspec.GridSpec(nRows, nCols) pnum_ = df2.get_pnum_func(nRows, nCols) fig = df2.figure(fnum=fnum, pnum=pnum_(0)) fig.clf() for px, img in enumerate(img_list): title = 'test title' bbox_list = [dummy_bbox(img), dummy_bbox(img, (-.25, -.25), .1)] theta_list = [tau * .7, tau * .9] sel_list = [True, False] label_list = ['test label', 'lbl2'] viz_image2.show_image(img, bbox_list=bbox_list, title=title, sel_list=sel_list, label_list=label_list, theta_list=theta_list, fnum=fnum, pnum=pnum_(px))
def test_viz_image(img_fpath): # Read image img = cv2.imread(img_fpath) tau = np.pi * 2 # References: tauday.com # Create figure fig = df2.figure(fnum=42, pnum=(1, 1, 1)) # Clear figure fig.clf() # Build parameters bbox_list = [dummy_bbox(img), dummy_bbox(img, (-.25, -.25), .1)] showkw = { 'title': 'test axis title', # The list of bounding boxes to be drawn on the image 'bbox_list': bbox_list, 'theta_list': [tau * .7, tau * .9], 'sel_list': [True, False], 'label_list': ['test label', 'lbl2'], } # Print the keyword arguments to illustrate their format print('showkw = ' + utool.dict_str(showkw)) # Display the image in figure-num 42, using a 1x1 axis grid in the first # axis. Pass showkw as keyword arguments. viz_image2.show_image(img, fnum=42, pnum=(1, 1, 1), **showkw) df2.set_figtitle('Test figure title')
def test_viz_image(img_fpath): # Read image img = cv2.imread(img_fpath) tau = np.pi * 2 # References: tauday.com # Create figure fig = df2.figure(fnum=42, pnum=(1, 1, 1)) # Clear figure fig.clf() # Build parameters bbox_list = [dummy_bbox(img), dummy_bbox(img, (-0.25, -0.25), 0.1)] showkw = { "title": "test axis title", # The list of bounding boxes to be drawn on the image "bbox_list": bbox_list, "theta_list": [tau * 0.7, tau * 0.9], "sel_list": [True, False], "label_list": ["test label", "lbl2"], } # Print the keyword arguments to illustrate their format print("showkw = " + utool.dict_str(showkw)) # Display the image in figure-num 42, using a 1x1 axis grid in the first # axis. Pass showkw as keyword arguments. viz_image2.show_image(img, fnum=42, pnum=(1, 1, 1), **showkw) df2.set_figtitle("Test figure title")