jnjaby / DISCNet

Code for DISCNet.
99 stars 16 forks source link

Test your own data set #22

Closed KKKLeouee closed 1 year ago

KKKLeouee commented 2 years ago

Hello, how are you going to .Jpg to .NPY, after I used the conversion code I wrote, the test results were very different from those in the paper. This is my conversion code. How did you convert it.

def jpgtonpy(path): for file in os.listdir(path): sourceDir1 = os.path.join(path, file) im1 = cv2.imread(sourceDir1) file_name = os.path.join(path, file.split('.')[0] + '.npy') np.save(file_name, im1[:,:,::-1])

i look forward to your reply

jnjaby commented 2 years ago

Hi, cv.imread will return image with data type uint8. You need to first convert it into np.float and then store as .NPY file.