I got a folder with 1976 training images. Each image has a shape (118,128,1) (greyscaled images). I created an array with all the images like this:
import glob
import scipy
import cv2
images = [cv2.imread(path, 0) for path in glob.glob('rootDir/train/*.png')]
images = np.asarray(images)
which yields:
images
out[0] array([[[ 38, 47, 51, ..., 53, 53, 46],
[ 48, 49, 50, ..., 53, 50, 51],
[ 48, 51, 53, ..., 54, 50, 51],
...,
[ 59, 61, 57, ..., 194, 195, 200],
[ 76, 71, 65, ..., 212, 212, 199],
[ 81, 80, 77, ..., 179, 184, 197]],
....
images.shape
out[1]: (1976, 128, 118)
now the thing is, i have the images's labels stored in a csv file in the following format:
id,appliance
1000,8
1001,1
1002,8
1003,1
1004,6
1005,1
1006,1
1007,2
1008
1009,5
1010
1011,3
1012,2
....
the id matches the filename of each image and the "appliance" column contains the label values assigned to each image for training.
In order to feed this data to a CNN model using CNTK I need to convert the image data into a one-hot encoded array with the image features and its labels. The expected output I would like to have would be something like this:
|labels 0 0 0 1 0 0 0 0 0 0 |features 0 0 0 0 ...
(15104 integers each representing a pixel)
I'm totally lost and appreciate any help on this.
EDIT IN RESPONSE TO DAN-MASEK'S COMMENT:
Hi Dan, here's the screenshot of the error:
as i said before, i set the variable ID_APP_MAP_FILENAME = 'train_labels.csv' like this. Tell me if you need any further information. Thank you