yizhezhang2000/SAMAug

Lossy conversion from float64 to uint8. Range [0.043137254901960784, 365.989235236598]. Convert image to uint8 prior to saving to suppress this warning.

Closed this issue · 3 comments

I want to test an image,but it doesn't work.Any problems about my dataset?

Hi, the image saving function finds the values are not between 0 and 255, and are not in uint8. But I think this is just a warning sign, and the image saving function should already saved the image to the path you specified. Before saving the image, I believe the image saving function did value normalizations and conversions for you. To avoid this warning message, you may choose to normalize and convert the values by your own functions before calling the image saving function.

Yes, as you said, I converted the format, but because this pixel of my image has been damaged to a certain extent, it may also be that my image does not fit this model, and the accuracy of the enhanced image test is not as high as the original.

Hi, thanks for your feedback. A few things I would like to mention.
(1) Saving the images is not a must step to run SAMAug. One may consider using SAMAug on the fly without saving the augmented data in the image formats (e.g., jpg) on the hard disk. For example, if your datasets are not too large, you may consider having the augmented images in arrays in float numbers in the computer memory (and using these data for model training and testing). This avoids performing normalization for making the values between 0 and 1 (or 0 and 255 for the uint8 format). Doing this requires pre-computing and pre-storing all the augmented images (including the training and testing images) in the computer memory. The experiments on the MoNuSeg and GlaS were performed in this fashion.

(2) Using SAMAug requires training the segmentation model with SAM-augmented images first. If the model has never seen SAM-augmented images in training, the model will not perform well in testing on the SAM-augmented testing images.