Commit 981ab247 authored by E144069X's avatar E144069X

Merged the two datasets

parent ab5c627c
......@@ -367,7 +367,7 @@ def plotData(nbClass,dataset):
nbImages += len(load_data.getGT(os.path.splitext(os.path.basename(videoPath))[0],dataset))
plt.figure()
plt.bar(np.arange(nbClass),priors*nbImages)
plt.bar(np.arange(nbClass),priors*nbImages,width=1)
plt.xticks(np.arange(nbClass),labels,rotation=45)
plt.xlabel("Developpement phases")
plt.ylabel("Number of images")
......@@ -676,35 +676,32 @@ def phaseNbHist(datasets,density):
return x.shape[0]
def computeLength(x):
times = np.genfromtxt(x,delimiter=",")[1:]
return times[-1,1]-times[0,1]
for dataset in datasets:
paths = glob.glob("../data/small/annotations/*phases.csv")
paths += glob.glob("../data/big/annotations/*phases.csv")
phases_nb_list = list(map(countRows,paths))
phases_nb_list = list(map(countRows,sorted(glob.glob("../data/{}/annotations/*phases.csv".format(dataset)))))
plt.figure(1)
plt.hist(phases_nb_list,label=dataset,alpha=0.5,density=density,bins=16,range=(0,16),edgecolor='black')
plt.figure(1)
plt.hist(phases_nb_list,alpha=0.5,density=density,bins=16,range=(0,16),edgecolor='black')
videoLengths = list(map(computeLength,sorted(glob.glob("../data/{}/annotations/*timeElapsed.csv".format(dataset)))))
paths = glob.glob("../data/small/annotations/*timeElapsed.csv")
paths += glob.glob("../data/big/annotations/*timeElapsed.csv")
videoLengths = list(map(computeLength,paths))
plt.figure(2)
plt.hist(videoLengths,label=dataset,alpha=0.5,bins=20,range=(0,180),density=density,edgecolor='black')
plt.figure(2)
plt.hist(videoLengths,alpha=0.5,bins=20,range=(0,180),density=density,edgecolor='black')
plt.figure(1)
plt.xticks(np.arange(16)+0.5,np.arange(16))
plt.xlabel("Number of phases")
plt.ylabel("Density")
plt.title("Number of annotated phases in the dataset(s) : "+",".join(datasets))
plt.legend()
plt.savefig("../vis/nbScenes_{}_density{}.png".format("_".join(datasets),density))
plt.ylabel("Number of videos")
plt.savefig("../vis/nbPhases_density{}.png".format(density))
plt.close()
plt.figure(2)
plt.legend()
plt.savefig("../vis/scenesLengths_{}_density{}.png".format("_".join(datasets),density))
plt.savefig("../vis/phasesLengths_density{}.png".format(density))
plt.close()
def plotConfusionMatrix(exp_id,model_id,epochToProcess,dataset_test,test_part_beg,test_part_end):
......@@ -1002,6 +999,5 @@ def main(argv=None):
plotPoints(args.exp_id,args.model_id,args.epoch_to_process)
if args.plot_points_image_dataset:
plotPointsImageDataset(args.image_nb,args.reduction_fact,args.plot_depth,args)
if __name__ == "__main__":
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment