コード例 #1
0
    def inputProcedData(self):
        filesize = int(self.frmSizeBox.text())
        print "Input proced data", filesize
        self.fname = [str(self.txtSepFile.text())]
        input_data = data_proc2.load_proced_data_flag(self.fname,
                                                      datalen=filesize)

        self.loadInputData(input_data)
コード例 #2
0
dim_h = args.n_units
batchsize = args.batchsize
bprop_len = args.bprop_len
grad_clip = 1

train_file = glob.glob(args.train_dir + "/*")
s_train_file = glob.glob(args.s_train_dir + "/*")

valid_file = glob.glob(args.valid_dir + "/*")
test_file = glob.glob(args.test_dir + "/*")

if len(train_file) == 0:
    print "error train folder no file!"

train_data = data_proc2.load_proced_data(train_file)  #(joints, speaks, annos)
s_train_data = data_proc2.load_proced_data_flag(
    s_train_file)  #(joints, speaks, annos)

valid_data = data_proc2.load_proced_data(valid_file, datalen=args.datalen)
test_data = data_proc2.load_proced_data(test_file, datalen=args.datalen)

print("train_data:", train_data[0].shape, train_data[2].shape,
      train_data[2].shape)

# Data set
train_joints, train_speaks, train_annos = train_data[0], train_data[
    1], train_data[2]
s_train_joints, s_train_speaks, s_train_annos, s_train_flags = s_train_data[
    "joints"], s_train_data["speaks"], s_train_data["annos"], s_train_data[
        "flags"]

valid_joints, valid_speaks, valid_annos = valid_data[0], valid_data[
コード例 #3
0
            start = t
        if data[t] == 1 and data[t+1] == 0:
            sum_time += sum(diff_time[start:t])
            
    return sum_time
    
fnames = sorted(glob.glob(args.filename+"/*"))

cap = ["person", "robot"]
types = ["model", "control", "random", "person"]



for n, fname in enumerate(fnames):

    input_data = data_proc2.load_proced_data_flag([fname], datalen=-1) #(1000, 2)
    a_data = np.abs(input_data["annos"])#[:1000]
    t_data = input_data["times"]#[:1000]

    diff_time = []
    for i in range(len(t_data)-1):
        if i == 0:
            diff_time.append(0)
        else:
            diff_time.append(t_data[i+1]-t_data[i])


    plt.subplot(4,1,n+1)

    if n < 3:
        barh_plot(a_data[:,0], a_data[:,1], t_data)