Ejemplo n.º 1
0
                                imgWNew=imgWNew)

# # Reading face data, preparation of data and training of the model
mySAMpy.readData(dataPath, participantList, pose_index)

minImages = mySAMpy.Y.shape[1]
Ntr = int(minImages * ratioData / 100)
Ntest = minImages - Ntr

allPersonsY = mySAMpy.Y
allPersonsL = mySAMpy.L

for i in range(len(participantList)):
    #print participantList[i]
    mySAMpy.Y = allPersonsY[:, :, i, None]
    mySAMpy.L = allPersonsL[:, :, i, None]
    (Yalli, Lalli, YtestAlli, LtestAlli) = mySAMpy.prepareData(model_type,
                                                               Ntr,
                                                               pose_selection,
                                                               randSeed=2)

    if (i == 0):
        Yall = Yalli.copy()
        Lall = Lalli.copy()
        YtestAll = YtestAlli.copy()
        LtestAll = LtestAlli.copy()
    else:
        Yall = np.vstack([Yall, Yalli])
        Lall = np.vstack([Lall, Lalli])
        YtestAll = np.vstack([YtestAll, YtestAlli])
        LtestAll = np.vstack([LtestAll, LtestAlli])
Ejemplo n.º 2
0
mySAMpy = SAMDriver_interaction(False, imgH = imgH, imgW = imgW, imgHNew = imgHNew, imgWNew = imgWNew)

# # Reading face data, preparation of data and training of the model
mySAMpy.readData(dataPath, participantList, pose_index)

minImages = mySAMpy.Y.shape[1]
Ntr = int(minImages*ratioData/100)
Ntest = minImages - Ntr

allPersonsY = mySAMpy.Y;
allPersonsL = mySAMpy.L;

for i in range(len(participantList)):
	#print participantList[i]
	mySAMpy.Y = allPersonsY[:,:,i,None]
	mySAMpy.L = allPersonsL[:,:,i,None]
	(Yalli, Lalli, YtestAlli, LtestAlli) = mySAMpy.prepareData(model_type, Ntr, pose_selection, randSeed=2)

	if(i==0):
		Yall = Yalli.copy();
		Lall = Lalli.copy();
		YtestAll = YtestAlli.copy()
		LtestAll = LtestAlli.copy()
	else:
		Yall = np.vstack([Yall,Yalli])
		Lall = np.vstack([Lall,Lalli])
		YtestAll = np.vstack([YtestAll,YtestAlli])
		LtestAll = np.vstack([LtestAll, LtestAlli])

allPersonsY = None
alPersonsL = None