My question is about uploading an image file to s3 (minio). After I upload jpeg or tif file on s3, I attempt to download these images but these are different when I compare with the original images. Same problem is not valid for png files, I can reach the original information inside of the image.
I also did not compress the images, I’ve followed the deep lake instructions. Why is that happening?
In the following, I shared the code snippets.
upload_images.py
dirpath = /home/images
ds = deeplake.empty('s3://deeplake/image-dataset', creds=credentials)
files = []
for file in os.listdir(dirpath):
files.append(os.path.join(dirpath, file))
with ds:
ds.create_tensor('images', htype='image', sample_compression=None)
with ds:
for file in files:
ds.append({'images': deeplake.read(file)})
download_images.py
ds = deeplake.load('s3://deeplake/image-dataset', creds=credentials)
image_tensor = ds['images']
for i in range(len(image_tensor)):
image_data = image_tensor[i].numpy()
# For RGB images
image = Image.fromarray(image_data, mode='RGB')
image.save(f"home/downloaded_images/image{i}.jpg", format='jpeg')
I’ve tried to use as None sample_compression and chunk compression options. After that I’ve changed as specific format for the file (jpg, tiff, png). Result has not changed, the original images’ properties did not protected.