For each person in my dataset, I have a labelled collection of a pair of images from their different profiles .For person A, data looks like:
PersonA FacebookImage InstagramImage 0 (0 is the label, if both images belong to person A)
I have generated embeddings(as a numpy array) for each image of length 128 and concatenated them to a numpy array as pair.
The main idea is to train the classifier such that two embeddings of images belonging to same person are similar.
The training data looks similar to:
[[[0 3 4.............. [0 1 .........
............. ............
................. .............
.................128] .........128]]...................]]]
and the training labels data looks like:
[0,1,1,0,0,.........]
where each pair is pair of embeddings of same person. I am trying to train these embeddings on a SVM classifier,using the code:
clf = svm.SVC(kernel='linear', C=1).fit(X_train, y_train)
but I am encountered with an error message:
Found array with dim 3. Estimator expected <= 2.
How can I resolve this error?
The shape of my training set is (2000,2,128) and the shape of each embedding is (128,)