uptake / autofocus

Deep learning computer vision for classifying wildlife in camera trap images
BSD 3-Clause "New" or "Revised" License
54 stars 30 forks source link

autofocus won't predict with JPG (all caps) #105

Closed mfidino closed 5 years ago

mfidino commented 5 years ago

curl -F "file=@./gallery/fawn.JPG" -X POST http://0.0.0.0:8000/predict

returns: File type not allowed. File must be of type {'png', 'jpeg', 'bmp', 'gif', 'jpg'}

While curl -F "file=@./gallery/fawn.jpg" -X POST http://0.0.0.0:8000/predict

returns

{"beaver":9.246710855727618e-19,"bird":2.46549984694866e-06,"cat":4.103247075448735e-09,"chipmunk":1.8603681928297533e-09,"coyote":4.131159948883578e-05,"deer":0.998934805393219,"dog":2.423930709483102e-06,"empty":0.008148271590471268,"fox":3.7362850943491763e-16,"human":2.2689566776534775e-06,"mink":1.8892157210506503e-15,"mouse":7.988450179130524e-12,"muskrat":6.45677457901284e-18,"opossum":4.68526195618324e-08,"rabbit":2.0991001292713918e-05,"raccoon":3.645797619356017e-07,"rat":4.5033796136628723e-10,"skunk":3.03820506530883e-08,"squirrel":1.2053419595758896e-06,"unknown":1.7319482140010223e-05,"woodchuck":9.742141998219822e-18}

Note that fawn.JPG does not exist in the gallery folder (though it is in gallery.zip).

mfidino commented 5 years ago

Looks like the JPG file was not included in gallery because JPG is in the .gitignore:

https://github.com/uptake/autofocus/blob/735dde586a67b6466a5818b215d503731c2de677/.gitignore#L95

I'm working on some image preprocessing in R that follows a bit of what is done in preprocess.py and makes a temporary jpg that can get sent to predict.

gsganden commented 5 years ago

The container gsganden/autofocus_serve:1.2.2 on dockerhub has a fix already. I'm working on a fix for the code. I'm not sure what happened -- I thought that I was passing a test for this issue.