mxnet-im2rec_tutorial
mxnet-im2rec_tutorial copied to clipboard
how to run generate dataset.lst code
hi, thank you for your nice code. i am a newbie in programming, would you please tell me more about how to run the generate dataset.lst code properly?
i have image stored under train folder, with images named as id_1_labels_[95, 66, 137, 70, 20].jpg. inside [] are the label of the image. i tried to run the generate dataset.lst code as:
python lstgen.py /Users/Anna/.kaggle/competitions/imaterialistchallengefashion2018/train
but the .lst file doesn't look right. thank you for your valuable help.
hello , Sorry for my late reply I’m not sure I understand what you mean. you have a image and it named as id_1_labels_[95,66,137,70,20].jpg i think first you should use
from os import listdir
train_path = 'D:/DeepLearning/ ...' # your training image path
img_name = [f for f in listdir(train_path)]
print(img_name)
and split image_name like this
img_names = 'id_1_labels_[95, 66, 137, 70, 20].jpg'
anno = img_names.split('_')
xywhc = (anno[3].split('.')[0])[1:-1].split(',')
print(anno)
print(xywhc)
if you didn't know the WxH of image ,just use skimage or opencv to open it! and check each shape to normalization
I see. and replace the #class with xywhc? Thank you for such detailed explanation!