kukuruza / City-Project

Analyze traffic given a set of optical cameras in urban areas
0 stars 0 forks source link

Python deployment needs to be run directly through memory #30

Closed shinysingh closed 9 years ago

shinysingh commented 9 years ago

The original deployment was run through C++ with the images on disks. We want to run the deployment with Python wrapper without saving the image onto disk.

The python deployment currently takes an image as an input and classifies it accordingly.

The code needs to be changed so that it doesn't require a saved image as input and runs directly on the patch.

satwikkottur commented 9 years ago

Btw, can I be of any help in the CNN side of things ?

@kukuruza, we have to discuss about ways to generate candidates. That aside, anything else I can help with ?

kukuruza commented 9 years ago

Got interface with commit 3eb68223d5da9bfd2b4aea661fcd2b765530a303 Used https://github.com/BVLC/caffe/blob/master/python/caffe/io.py to see the way they load images

kukuruza commented 9 years ago

@shinysingh , your python deployment always predicts zero with the model and network that you are using for deployment. What do you think is going on?

shinysingh commented 9 years ago

That is a problem with python. A lot of users have had that issue. It has to do with the way python performs the prediction. It uses some sort of interpolation and doesn't operate on the entire image. I've looked this up before as well but I'm not sure what the way around is.

kukuruza commented 9 years ago

So how can we solve that?

shinysingh commented 9 years ago

can you try running it now? I changed the code a bit.

kukuruza commented 9 years ago

Shiny, change it in git please

shinysingh commented 9 years ago

Is it working now?

kukuruza commented 9 years ago

I pull from git, so I test it after you push to there

kukuruza commented 9 years ago

Did you try it on the server? On my laptop, I get:

Traceback (most recent call last):
  File "/Users/evg/projects/City-Project/src/cnn/DeploymentPatches.py", line 58, in <module>
    label = deployment.classify(patch)
  File "/Users/evg/projects/City-Project/src/cnn/DeploymentPatches.py", line 50, in classify
    return out['output']
KeyError: 'output'
shinysingh commented 9 years ago

Yes it worked on the server. It probably doesn't work for you because I changed the deploy_python.prototxt as well. It's in the data folder.

kukuruza commented 9 years ago

You are right! But all zeros still... :( Do you have other ideas? Otherwise we can meet tomorrow, try to figure out how to solve it

kukuruza commented 9 years ago

It was figured out in commit f0733163ae293dbad7c8fa9b0bf4485adbfba9b7. File DeploymentPatches is responsible for deployment. Commit d568e9ae2dcd5e5552a89ad80bc3c0c168ef6d62 completes Shiny's code.