text: import os
  import numpy as np
  
  if not os.path.exists('./npydata'):
      os.makedirs('./npydata')
  
  jhu_root = 'jhu_crowd_v2.0'
  
  
  try:
  
      Jhu_train_path = jhu_root + '/train/images_2048/'
      Jhu_val_path = jhu_root + '/val/images_2048/'
      jhu_test_path = jhu_root + '/test/images_2048/'
  
      train_list = []
      for filename in os.listdir(Jhu_train_path):
          if filename.split('.')[1] == 'jpg':
              train_list.append(Jhu_train_path + filename)
      train_list.sort()
      np.save('./npydata/jhu_train.npy', train_list)
  
      val_list = []
      for filename in os.listdir(Jhu_val_path):
          if filename.split('.')[1] == 'jpg':
              val_list.append(Jhu_val_path + filename)
      val_list.sort()
      np.save('./npydata/jhu_val.npy', val_list)
  
      test_list = []
      for filename in os.listdir(jhu_test_path):
          if filename.split('.')[1] == 'jpg':
              test_list.append(jhu_test_path + filename)
      test_list.sort()
      np.save('./npydata/jhu_test.npy', test_list)
  
      print("Generate JHU image list successfully")
  except:
      print("The JHU dataset path is wrong. Please check your path.")
  