DCL icon indicating copy to clipboard operation
DCL copied to clipboard

problem with st_car datasets

Open minushuang opened this issue 5 years ago • 3 comments

It seems that the train.txt of STCAR porvided by source code is incorrect, the filename in the train.txt can not map to the source images. such as 013178.jpg ,013191.jpg,013434.jpg and so on.

minushuang avatar Dec 17 '19 02:12 minushuang

It seems that the train.txt of STCAR porvided by source code is incorrect, the filename in the train.txt can not map to the source images. such as 013178.jpg ,013191.jpg,013434.jpg and so on.

I had the same problem when I used the CUB dataset.

98Ray avatar Oct 09 '20 12:10 98Ray

They seem to combine the original dataset. cars_test(8041) cars_train(8144)

xuyangwang0825 avatar Apr 19 '21 05:04 xuyangwang0825

They seem to combine the original dataset. cars_test(8041) cars_train(8144)

OK, I got this! The annos should be downloaded from here The dataset should be downloaded from here

I think the writer maybe process the annos like the code following:

import scipy.io as spio
def processingLabel():
    data = spio.loadmat('./cars_annos.mat')
    annotations = data['annotations']
    f_train = open('mat2txt_train.txt', 'w')
    f_test = open('mat2txt_test.txt', 'w')
    num = 1
    for i in range(annotations.shape[1]):
        name = str(annotations[0, i][0])[2:-2]
        test = int(annotations[0, i][6])
        clas = int(annotations[0, i][5])

        name = str(name)
        clas = str(clas)
        test = str(test)
        if test == '0' :
            f_train.write(name[8:] + ' ' + clas + '\n')
        else:
            f_test.write(name[8:] + ' ' + clas + '\n')

    f_train.close()
    f_test.close()

xuyangwang0825 avatar Apr 19 '21 07:04 xuyangwang0825