Skip to content
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

predict image issue #17

Open
akasrawa opened this issue Dec 8, 2020 · 7 comments
Open

predict image issue #17

akasrawa opened this issue Dec 8, 2020 · 7 comments

Comments

@akasrawa
Copy link

akasrawa commented Dec 8, 2020

I did training and got dataset .h5
How i can predict for single/multi image to get result as positive(0) or negative(1).

please support to share/add the file for prediction image.

thanks in advance

@eldoabrahm
Copy link

Did you try out the step 5 in the README?
That should help you out

@akasrawa
Copy link
Author

Thanks dear for your replay.

I added one normal image in positive image folder and run the test , its come with below error.
is there something wrong or mean the image is normal image.

I am trying to understand TP,FP,TN,FN .
How i can know if the image is normal or screen from the result.

confusion matrix (test / validation)
true positive: 0
false positive: 0
true negative: 0
false negative: 4

accuracy: 0.0000 %
Traceback (most recent call last):
File "test.py", line 66, in
main(parse_arguments(sys.argv[1:]))
File "test.py", line 46, in main
evaluate(CNN_model,X_LL,X_LH,X_HL,X_HH, Y)
File "C:\Users\DELL\Desktop\Moire-Pattern-Detection-master\src\train.py", line 305, in evaluate
print(start + 'precision: ' + end + "{:.4f} %".format(100*TP/(TP + FP)))
ZeroDivisionError: division by zero

@eldoabrahm
Copy link

eldoabrahm commented Dec 14, 2020

You have 4 false negative, that means the images which were taken from screen were incorrectly classified as normal.
You would need to train you model using better datasets and use more test data for validation.

To understand the formula for which you got an error, read this: https://towardsdatascience.com/accuracy-precision-recall-or-f1-331fb37c5cb9

@tkone2018
Copy link

@akasrawa hello, did you test single image success? and can you share your tensorflow and keras version? thanks

@amilkcar
Copy link

amilkcar commented May 7, 2022

@akasrawa hello, did you test single image success? and can you share your tensorflow and keras version? thanks

guys (@akasrawa , @tkone2018 ) anyone of you had a success implementing this.. i am trying to test a sole image but even the test(referenced in readme) is not working.. i am getting..

ValueError: Cannot assign value to variable ' dense_1/kernel:0': Shape mismatch.The variable shape (32, 2), and the assigned value shape (32, 1) are incompatible.

@MarouaneSH
Copy link

@amilkcar I get the same issue! did you manage to resolve it ?

@luoyexk
Copy link

luoyexk commented Jan 4, 2023

May be this issue can help you.

#27 (comment)

@amilkcar @MarouaneSH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants