Moire-Pattern-Detection icon indicating copy to clipboard operation
Moire-Pattern-Detection copied to clipboard

predict image issue

Open akasrawa opened this issue 4 years ago • 7 comments

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

akasrawa avatar Dec 08 '20 20:12 akasrawa

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

eldoabrahm avatar Dec 12 '20 19:12 eldoabrahm

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

akasrawa avatar Dec 13 '20 21:12 akasrawa

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

eldoabrahm avatar Dec 14 '20 14:12 eldoabrahm

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

world2025 avatar Dec 18 '20 02:12 world2025

@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.

amilkcar avatar May 07 '22 06:05 amilkcar

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

MarouaneSH avatar Nov 15 '22 19:11 MarouaneSH

May be this issue can help you.

https://github.com/AmadeusITGroup/Moire-Pattern-Detection/issues/27#issue-1518171464

@amilkcar @MarouaneSH

luoyexk avatar Jan 04 '23 01:01 luoyexk