File size: 712 Bytes
59b2a81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os, sys, shutil
import numpy as np
import matplotlib.pyplot as plt


if __name__ == "__main__":
    input_folder_path = "../Bridge_v2"
    
    average_length = []

    # Iterate each file
    for sub_folder_name in sorted(os.listdir(input_folder_path)):
        sub_folder_path = os.path.join(input_folder_path, sub_folder_name)
        
        average_length.append(len(os.listdir(sub_folder_path)))       # Have more than one than expected, but we keep this 
        print("average length of {} is {}".format(sub_folder_name, average_length[-1]))

    print("average_movement_list is ", average_length)
    n, bins, patches = plt.hist(average_length, bins=100)
    plt.savefig("dataset_length2.png")