Python Forum
Kera how to load a dataset of images stored to my computer, not the Cifar-10?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Kera how to load a dataset of images stored to my computer, not the Cifar-10?
#1
Because I am searching but I cannot figure out how to make it work. Is there any way to load an image dataset stored in my PC ('png') so that it can be read by: trainX, trainY, testX, testY?? Because most of what I found is like this: (x_train, y_train), (x_test, y_test) = mnist.load_data() or (trainX, trainY), (testX, testY) = cifar10.load_data()
Reply
#2
Do you mean like this?
def somefunc():
    return ('trainX', 'trainY'), ('testX', 'testY')

train, test = somefunc()
print(train, test)
Output:
('trainX', 'trainY') ('testX', 'testY')

Or maybe
def somefunc():
    return 'trainX', 'trainY', 'testX', 'testY'

trainX, trainY, testX, testY = somefunc()
print(trainX, trainY, testX, testY )
Output:
trainX trainY testX testY

Note it depends how mnist.load_data() returns its data, you could always make a function to return it how you wanted it
see this post for details of sequence unpacking
Reply
#3
No, I mean this:

When I run
(x_train, y_train), (x_test, y_test) = mnist.load_data()
it loads mnist dataset. I need instead of the mnist dataset to load the folder with the .png images that I have stored on my PC and contains 2 folders inside, the one folder has the training dataset and the other is the test dataset.

Thank you
Reply
#4
Sorry, but from that one line and your description I don't understand Think , maybe someone else will
Reply
#5
For example: this tutorial here:

CNN code

uses cifar10 dataset. I want to transform the code to load a dataset of images stored to my computer, not the Cifar-10. How do I achieve this?

(Better now?)
Reply
#6
Kera > Code examples / Computer Vision / Image classification from scratch
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Kera Getting errors when following code example Image classification from scratch hobbyist 3 4,609 Apr-13-2021, 01:26 PM
Last Post: amirian
  Mass load images Linuxdesire 1 2,220 Mar-29-2019, 06:24 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020