Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import glob
- import numpy as np
- import pandas as pd
- import matplotlib.cm as cm
- import ipywidgets as widgets
- import matplotlib.pyplot as plt
- import xml.etree.ElementTree as ET
- import matplotlib.patches as patches
- from PIL import Image
- from shutil import copyfile
- from ipywidgets import interact
- from matplotlib.cm import get_cmap
- plt.rcParams['figure.figsize'] = 20, 12
- def show_images(index):
- fig, axes = plt.subplots(3, 2)
- seg_path1 = histograms[index][0]
- geo_path1 = histograms[index][1]
- seg_path2 = histograms[index+1][0]
- geo_path2 = histograms[index+1][1]
- seg_path3 = histograms[index+2][0]
- geo_path3 = histograms[index+2][1]
- img1 = Image.open(seg_path1)
- img2 = Image.open(geo_path1)
- img3 = Image.open(seg_path2)
- img4 = Image.open(geo_path2)
- img5 = Image.open(seg_path3)
- img6 = Image.open(geo_path3)
- axes[0][0].set_title(str(index) + " " + os.path.basename(seg_path1))
- axes[0][1].set_title(str(index) + " " + os.path.basename(geo_path1))
- axes[1][0].set_title(str(index+1) + " " + os.path.basename(seg_path2))
- axes[1][1].set_title(str(index+1) + " " + os.path.basename(geo_path2))
- axes[2][0].set_title(str(index+2) + " " + os.path.basename(seg_path3))
- axes[2][1].set_title(str(index+2) + " " + os.path.basename(geo_path3))
- axes[0][0].imshow(img1)
- axes[0][1].imshow(img2)
- axes[1][0].imshow(img3)
- axes[1][1].imshow(img4)
- axes[2][0].imshow(img5)
- axes[2][1].imshow(img6)
- index = widgets.IntSlider(min=0, max=len(histograms)-1, step=3,value=0)
- interact(show_images, index=index);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement