lorisbaz / SDALF

Person re-identification with SDALF - CVPR 2010
BSD 2-Clause "Simplified" License
28 stars 17 forks source link

Errors in setDataset and crossvalidation #4

Closed hsvoen closed 9 years ago

hsvoen commented 9 years ago

When I try to run the L_main_tagging_SvsS.m function with the VIPeR dataset, I get problems at line 22 in the SetDataset function, dset(j).globalindex = [dset(j).globalindex permit_inds(i)]; with dset being undefined.

I managed to fix that by copypaste some code out of the for loop at the start of the function, but then I got an error with line 95 in crossvalidation.m, that says Index exceeds matrix dimensions.

I'm not sure if the last problem is something I introduced when I made changes in setdataset.m, but I can't get the code to work at any rate.

lorisbaz commented 9 years ago

If you got that error, it means that lines 17-20 where not executed before. The function dynamically create the dset variable for each person j. It scans dir_e_list and add a new element when idperson ~= idpersonold.

A reason why that might not work in your case is because you did not rename the images of the dataset VIPeR. The images have to be in a single folder with the following name: XXXXYYY.bmp XXXX = person ID YYY = {001 for cam_a, 002 for cam_b} e.g.: 0004002.bmp is person 4 view cam_b
Notice that our XXXX starts from 1 while the original one starts from 0.

hsvoen commented 9 years ago

Thanks, I got it to work now

Best regards Håvard Svoen

2015-03-03 18:06 GMT+01:00 Loris Bazzani notifications@github.com:

If you got that error, it means that lines 17-20 where not executed before. The function dynamically create the dset variable for each person j. It scans dir_e_list and add a new element when idperson ~= idpersonold.

A reason why that might not work in your case is because you did not rename the images of the dataset VIPeR. The images have to be in a single folder with the following name: XXXXYYY.bmp XXXX = person ID YYY = {001 for cam_a, 002 for cam_b} e.g.: 0004002.bmp is person 4 view cam_b

Notice that our XXXX starts from 1 while the original one starts from 0.

— Reply to this email directly or view it on GitHub https://github.com/lorisbaz/SDALF/issues/4#issuecomment-76987659.

arkobarman commented 9 years ago

I am getting a similar problem for ETHZ datasets. Is there any format in which I need to set the name of the images in the ETHZ dataset?

lorisbaz commented 9 years ago

As far as I remember the dataset ETHZ should be already in a format that is similar to VIPeR (after it is renamed as explained above). Therefore, ETHZ should work without any renaming.

Could you be more specific and maybe report the error? Please open a new issue.

eshabaninia commented 8 years ago

When i try to run L_main_tagging_MvsM with ETHZ1 i get the following error: Index exceeds matrix dimensions.

Error in blobs_inside_image (line 15) COV=mvec([4 5 5 6],:);

Error in MSCRmatch_DynVSDyn_Cl (line 69) [keep_list,BB]= blobs_inside_image(mser.mvec,[H,W]); % used to compute BB

Error in L_main_tagging_MvsM (line 233) MSCRmatch_DynVSDyn_Cl;

lorisbaz commented 8 years ago

It could be related to the fact that MSCR is not able to find any blob. But this is pretty unlikely since I run the experiment using ETHZ1 as reported in our CVPR paper.

I would suggest to debug the code step by step and find the reason why this is happening.

elefthk commented 7 years ago

I have had the same problem as hsvoen. For SetDataset.m I inserted the following before the for loop:

dset(1).globalindex = []; dset(1).index = []; j = 1;

Also, I was only interested in VIPeR. So I did not rename all the VIPeR images as lorisbaz suggests. Instead I copied all the images from cam_a and cam_b of the VIPeR dataset in a new folder named "VIPeRa" (or name it as you want and then change the dir_e variable accordingly). There were name conflicts for only two images so I just appended a "_b" in the end of those names. Then in SetDataset I replaced idperson = str2num(n(1:4)) with idperson = str2num(n(1:3)). The three first characters of the name of the .bmp's correspond to their id. The other characters are not used (at least for VIPeR -> only SvsS)

PS: I also had an issue with getmapping (with Matlab 2016a). bitshift with 3 args is as described here: https://www.mathworks.com/help/matlab/ref/bitshift.html. So I replaced line 37 of getmapping with:

j = bitset(bitshift(i,samples),1,bitget(i,samples));