facebookarchive / fb.resnet.torch

Torch implementation of ResNet from http://arxiv.org/abs/1512.03385 and training scripts
Other
2.29k stars 664 forks source link

dataset.lua,dataset-gen.lua #186

Open masaff opened 7 years ago

masaff commented 7 years ago

Hi,

I'm totally new to this. Can you please help me on preparing my new dataset. I have train and val directories each having different directories for different labels. I'm not sure how to change the imagenet.lua and imagenet-gen.lua file in order to serve my dataset. Should I first run init.lua? where should I add the path to my new dataset? I would appreciate it if you could walk me through this!

Thanks

onidzelskyi commented 6 years ago

I've the same question. Either using vmmrdb.zip or any other dataset with files organized into train and val directories accordingly and performing

  1. train th main.lua -data <path to dataset> -resetClassifier true -nClasses <#classes>

  2. Classify th pretrained/classify.lua gen/<model> <image>

we get a class related to imagenet labels (e.g. cat, flower, car, etc.). So, we need to generate new labels for dataset trained on step 1. If so, how we can do this using by imagenet.lua and imagenet-gen.lua scripts? when I'm run the command

th datasets/imagenet.lua -data <path to dataset>

or

th datasets/imagenet-gen.lua -data <path to dataset>

Nothing happens.

BTW, how can we use the index_class.t7 file? Is it useful for defining labels for custom dataset? Thanks in advance, Oleksii