-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inference on single images #8
Comments
hay @diana-xie ... did you find solution to your problem ? actually i also want to infer on single image .... |
Hi @diana-xie, I'm having the same issue you were having with all predictions for the Negative class. Did you find a solution? To troubleshoot, I modified inference(model) to add a column for the predicted class to the 'tf_inference_times.csv' output: |
Oh cool! No, I haven't found a solution yet. This is super helpful - thank you for posting. |
Hi @diana-xie, I think I found a solution. In the inference definition, can you change line 314 from img = resize(img, (224, 224)) to img = crop(img, (224, 224)) and check that it works for you? Thanks, Erin |
That worked for me @erinmgraham ! Thanks very much :D EDIT: #10 Alright view this PR for a fix! Hopefully gets merged soon. |
Hi Alex, thanks so much for sharing the code! I am new to deep learning and found your commented code very helpful and clear.
I am attempting to run inference on single images from your study, using one of your pre-trained models. I think I’m running into some issues though. I downloaded the ResNet-50 model (resnet.hdf5) and loaded it to make predictions on single images at a time (using deepweeds.inference() ). However all the predictions are for the Negative class, since this probability is always much higher than the remaining classes.
Also tried running model.predict_generator() (from deepweeds.cross_validate() ) on just a test subset of data (‘test_subset0.csv’), to see if the predictions turned out differently. This was done on a Google Colab notebook with GPU, but it seems to be hanging and not completing with both ~3500 images and ~10 images (to see if runtime was the issue).
Do you know what I might be doing wrong?
Thanks!
The text was updated successfully, but these errors were encountered: