-5

I have to classfier a medical images, but these images are big(3000x2900),, i need way to resize. and then training it. Can i training these images without resize???

1 Answers1

4

You can train your model without resizing your pictures . But it will be time consuming. And you may not get the best results. I recommend you resize them to 128x128 pixels. You can use the PIL library and resize each picture then save it to a different directory.

from PIL import Image
img = Image.open('/your iamge path/image.jpg') # image extension *.png,*.jpg
new_width  = 128
new_height = 128
img = img.resize((new_width, new_height), Image.ANTIALIAS)
img.save('/new directory path/output image name.png') # format may what u want ,*.png,*jpg,*.gif

This process is called preprocessing the dataset.

moe asal
  • 750
  • 8
  • 24
  • Thanks alot,, , could you please tell me how i can create my dataset to use my dataset instead of using mnist dataset?((((from keras.datasets import mnist))) i want to import my dataset – Mahmoud Smaida Aug 26 '19 at 14:04
  • Sorry dude, i don't know. But glad i helped you. – moe asal Aug 26 '19 at 14:05
  • But hey, this url might help you.https://elitedatascience.com/keras-tutorial-deep-learning-in-python – moe asal Aug 26 '19 at 14:07