title: How to extract images, labels from csv file and create a trainset using torch?
body: <p>I downloaded a dataset for facial key point detection the image and the labels were in a CSV file I extracted it using pandas but I don't know how to convert it into a tensor and load it into a data loader for training.</p>
  
  <pre><code>dataframe = pd.read_csv("training_facial_keypoints.csv")
  dataframe['Image'] = dataframe['Image'].apply(lambda i: np.fromstring(i, sep=' '))
  dataframe= dataframe.dropna()
  images_array = np.vstack(dataframe['Image'].values)/255.0
  images_array = images_array.astype(np.float32)
  images_array = images_array.reshape(-1, 96, 96, 1)
  print(images_array.shape)
  labels_array = dataframe[dataframe.columns[:-1]].values
  labels_array = (labels_array-48)/48
  labels_array = labels_array.astype(np.float32)
  </code></pre>
  
  <p>I have the images and labels in two arrays. How do I create a training set from this and use transforms.
  Then load it using a <code>dataloader</code>.</p>