ML_IDCard_Segmentation-TF-Keras icon indicating copy to clipboard operation
ML_IDCard_Segmentation-TF-Keras copied to clipboard

Getting black images as output for all images while running code in Jupyter notebook.

Open arunrathore45 opened this issue 2 years ago • 2 comments

And also there was problem with load_model so I replaced with tf.keras.models.load_model then i checked prediction, predictions coming zero for every image. Any solution?

arunrathore45 avatar Apr 02 '22 11:04 arunrathore45

Hi, the project is already more than 2 years old. If you had problems with load_model and replaced it, I assume that you are using a newer version of TF?! Maybe the prediction is not working correctly.

Another possibility is that you have to adjust the threshold. In the line: data["mask"] = cv2.threshold(np.array(img), 200, 255, cv2.THRESH_BINARY)[1]

Pls check if the output of the prediction is really completely 0, or if maybe just the thresholds don't match.

tobiassteidle avatar Apr 03 '22 10:04 tobiassteidle

I am using the same version of tensorflow from the requirements file and tried to adjust the threshold but nothing changed, the predicted image is always black. please any recommendation?

mohamedabdallah1996 avatar Jul 07 '22 07:07 mohamedabdallah1996