xbq1994 / META

ECCV 2022
15 stars 2 forks source link

CUHK-SYSU dataset #1

Closed pooplar closed 1 year ago

pooplar commented 1 year ago

When loading the CUHK-SYSU dataset, the error "cuhk_sysu/roped_images is not found" appears. Do you know how to solve this problem?

clarkkent0618 commented 1 year ago

Hi! Did you overcome this problem?

hyunseo0 commented 1 month ago

The CUHK-SYSU dataset has a person search structure, so it is necessary to crop only the person from the image.

To address this, use the MATLAB script below to convert the CUHK-SYSU dataset into cropped images, then proceed accordingly.

clc clear gap = 0; % 0: MATLAB, 1: c++/python print_num = 50; save_dir = 'cropped_image'; mkdir(save_dir) person_all = load('./annotation/Person.mat'); person_all = person_all.Person; cnt_total = 0; for i=1:length(person_all) cnt_total = cnt_total + person_all(i).nAppear; end cnt = 0; for i=1:length(person_all) for j=1:person_all(i).nAppear savename = [person_all(i).idname(1), num2str(str2num(person_all(i).idname(2:end)), '%05.f'), '_n', num2str(j, '%02.f'), '_s', num2str(str2num(person_all(i).scene(j).imname(2:end-4)), '%05.f') , '_hard', num2str(person_all(i).scene(j).ishard), '.png']; im_dir = fullfile('Image', 'SSM' , person_all(i).scene(j).imname); im = imread(im_dir); xmin = person_all(i).scene(j).idlocate(1) + gap; ymin = person_all(i).scene(j).idlocate(2) + gap; width = person_all(i).scene(j).idlocate(3); height = person_all(i).scene(j).idlocate(4); im_crop = im(ymin:ymin+height,xmin:xmin+width,:); imwrite(im_crop, fullfile(save_dir, savename)); cnt = cnt + 1; if rem(cnt, print_num) == 0 fprintf(['Save images: (', num2str(cnt), '/', num2str(cnt_total), ')\n']) end end end