soumith / imagenet-multiGPU.torch

an imagenet example in torch.
BSD 2-Clause "Simplified" License
402 stars 158 forks source link

added classification feature #22

Open cbarokk opened 9 years ago

cbarokk commented 9 years ago

The images to be classified must be in a subdirectory that is alone in its parent directory, e.g. /path/to/directory/classify/<pictures> Then, the option -classify should be invoked like this -classify /path/to/directory/

I added a classifyLoader that is derived from testLoader but only does forward passes and stores the top-1 predictions for each classes into a file called "predictions.txt".

I also added a Throughput measurement in data.lua that helps finding out the right batchSize.

cbarokk commented 9 years ago

not really happy with the if test if opt.classify == '' then -- no classification if you know a cleaner way... Also, perhaps the option -retrainshould be renamed to -modelCheckpoint or something...