qiaoguan / Person-reid-GAN-pytorch

A Pytorch Implementation of "Unlabeled Samples Generated by GAN Improve the Person Re-identification Baseline in vitro"(ICCV17)
158 stars 49 forks source link

no "train_new" file in 'data/market/pytorch/' #19

Open ping-sun opened 5 years ago

ping-sun commented 5 years ago

I run the train_baseline and met an error. In the train_baseline.py line176, a file 'train_new' is needed. However, after run 'python prepare.py', I only get 'train' and 'train_all' in file 'data/market/pytorch/'. Also in changeIndex.py line 17, the "train_save_path" is set to "val_new", is there something wrong?

XXXxiaoxiaoxia commented 5 years ago

I meet the same error!

Vincy-L commented 5 years ago

me too! do you know the reason??

Feesics commented 5 years ago

anyone solved this problem?

yunhyuck commented 5 years ago

You can execute this file. This creates the train_new folder.

python re_index.py

---------------------re_index.py------------------------ import os from shutil import copyfile original_path = './data/market/pytorch' def copyfolder(src, dst): files = os.listdir(src) if not os.path.isdir(dst): os.mkdir(dst) for tt in files: copyfile(src + '/' + tt, dst + '/' + tt) new_folders = ['train_new', 'val_new'] old_folders = ['train_all', 'val'] for train, data in zip(new_folders, old_folders): train_save_path = os.path.join(original_path, train) if not os.path.exists(train_save_path): os.mkdir(train_save_path) data_path = os.path.join(original_path, data) if not os.path.isdir(train_save_path): os.mkdir(train_save_path) reid_index = 0 folders = os.listdir(data_path) folders = sorted(folders) for foldernames in folders: copyfolder(data_path + '/' + foldernames, train_save_path + '/' + str(reid_index).zfill(4)) reid_index = reid_index + 1

Meimeiainaonao commented 4 years ago

hi, can you help me about this question?

https://github.com/qiaoguan/Person-reid-GAN-pytorch/issues/26

Thank you very much!

Meimeiainaonao commented 4 years ago

You can execute this file. This creates the train_new folder.

python re_index.py

---------------------re_index.py------------------------

import os from shutil import copyfile original_path = './data/market/pytorch' def copyfolder(src, dst): files = os.listdir(src) if not os.path.isdir(dst): os.mkdir(dst) for tt in files: copyfile(src + '/' + tt, dst + '/' + tt) new_folders = ['train_new', 'val_new'] old_folders = ['train_all', 'val'] for train, data in zip(new_folders, old_folders): train_save_path = os.path.join(original_path, train) if not os.path.exists(train_save_path): os.mkdir(train_save_path) data_path = os.path.join(original_path, data) if not os.path.isdir(train_save_path): os.mkdir(train_save_path) reid_index = 0 folders = os.listdir(data_path) folders = sorted(folders) for foldernames in folders: copyfolder(data_path + '/' + foldernames, train_save_path + '/' + str(reid_index).zfill(4)) reid_index = reid_index + 1

hi, can you help me about this question?

https://github.com/qiaoguan/Person-reid-GAN-pytorch/issues/26

Thank you very much!