AmadeusITGroup / Moire-Pattern-Detection

Other
117 stars 31 forks source link

predict image issue #17

Open akasrawa opened 3 years ago

akasrawa commented 3 years ago

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 commented 3 years ago

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

akasrawa commented 3 years ago

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 commented 3 years ago

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

world2025 commented 3 years ago

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

amilkcar commented 2 years ago

@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 commented 1 year ago

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

luoyexk commented 1 year ago

May be this issue can help you.

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

@amilkcar @MarouaneSH