At the end of the Convolutional Neural Network example there is an exercise to modify the program to use the Street View House Numbers (SVHN) data set. I have been working on this for the past few days and am finding it quite difficult to modify, especially since the data formats are different and the SVHN data set has variably sized images.
This example would be extremely valuable to build an image classifier for use in a production environment. Any ideas where I could get this completed exercise?
At the end of the Convolutional Neural Network example there is an exercise to modify the program to use the Street View House Numbers (SVHN) data set. I have been working on this for the past few days and am finding it quite difficult to modify, especially since the data formats are different and the SVHN data set has variably sized images.
This example would be extremely valuable to build an image classifier for use in a production environment. Any ideas where I could get this completed exercise?
--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/9c33c20c-70d5-4c42-87d2-8a5bbff73f9e%40tensorflow.org.
file_contents = sio.loadmat(file_name)
""" has all the classes for each object (aka label) """ print(file_contents['y'][1][0])
""" has all the RGB data for each object (aka uint8image?) """ print(file_contents['X'][1][0][0][0])class CIFAR10Record(object): pass result = CIFAR10Record()
# Dimensions of the images in the CIFAR-10 dataset. # See http://www.cs.toronto.edu/~kriz/cifar.html for a description of the # input format. label_bytes = 1 # 2 for CIFAR-100 result.height = 32 result.width = 32 result.depth = 3 image_bytes = result.height * result.width * result.depth # Every record consists of a label followed by the image, with a # fixed number of bytes for each. record_bytes = label_bytes + image_bytes
# Read a record, getting filenames from the filename_queue. No # header or footer in the CIFAR-10 format, so we leave header_bytes # and footer_bytes at their default of 0. reader = tf.FixedLengthRecordReader(record_bytes=record_bytes) result.key, value = reader.read(filename_queue)
# Convert from a string to a vector of uint8 that is record_bytes long. record_bytes = tf.decode_raw(value, tf.uint8)
# The first bytes represent the label, which we convert from uint8->int32. result.label = tf.cast( tf.slice(record_bytes, [0], [label_bytes]), tf.int32)
# The remaining bytes after the label represent the image, which we reshape # from [depth * height * width] to [depth, height, width]. depth_major = tf.reshape(tf.slice(record_bytes, [label_bytes], [image_bytes]), [result.depth, result.height, result.width]) # Convert from [depth, height, width] to [height, width, depth]. result.uint8image = tf.transpose(depth_major, [1, 2, 0])
return resultAt the end of the Convolutional Neural Network example there is an exercise to modify the program to use the Street View House Numbers (SVHN) data set. I have been working on this for the past few days and am finding it quite difficult to modify, especially since the data formats are different and the SVHN data set has variably sized images.
This example would be extremely valuable to build an image classifier for use in a production environment. Any ideas where I could get this completed exercise?