import numpy as np
import zipfile
import os
zip_source = '../../data/Video/Crowded3_frames.zip'
gt_zip_source = '../../data/Video/GT_Crowded3.zip'
zf = zipfile.ZipFile(zip_source, 'r')
fnames = sorted(zf.namelist())
zf_gt = zipfile.ZipFile(gt_zip_source, 'r')
fnames_gt = sorted(zf_gt.namelist())
from skimage.io import imread
import matplotlib.pyplot as plt
%pylab inline
Populating the interactive namespace from numpy and matplotlib
WARNING: pylab import has clobbered these variables: ['imread'] `%matplotlib` prevents importing * from pylab and numpy
seq0 = [685,705]
seq1 = [1173,1191]
for no in range(*seq1):
fid = zf.open('frame%04d.jpg'%no)
rgb = imread(fid)
fid = zf_gt.open('%d.png'%no)
supervision = imread(fid)
plt.figure(figsize=[10,10])
plt.subplot(1,2,1)
plt.title('rgb image')
plt.imshow(rgb)
plt.subplot(1,2,2)
plt.imshow(supervision)
plt.title('ground truth')
break #stop after one frame for test purpose