NervanaSystems / ModelZoo

neon model zoo
Apache License 2.0
176 stars 69 forks source link

Feature request: example code for predictions #3

Closed iaroslav-ai closed 8 years ago

iaroslav-ai commented 8 years ago

Currently all the scripts I saw only do evaluation of the pretrained model on the test set of the dataset they were trained on and output performance metric numbers in the end. In addition to this, it would be really nice to have a python code which takes custom inputs (e.g. some image) and shows outputs of the pretrained NN (e.g. top 5 classes predicted by VGG or caption for an image). Such code can be incredibly fun to play with, help to learn neon and can be really helpful with fast model deployment. I really enjoyed for example this demo: https://github.com/NervanaSystems/neon/tree/master/examples/imdb.

nervetumer commented 8 years ago

Sorry about the delay in responding to your request. I made a little example showing how to get the predictions from an alexnet model given a jpeg image. I hope it's what you are looking for. Here's a link to the gist and I will try to package this up with some ModelZoo enhancements coming up soon.

The gist showing an example of running inference on a JPG image is here: https://gist.github.com/nervetumer/a66cb01b9055351a87e959bf16fb473c

iaroslav-ai commented 8 years ago

Just verified that gist works. Awesome, thanks! To those who want to use this gist: you can download necessary dev kit ILSVRC2012_devkit_t12 for tasks 1 and 2 here.