It works. Thank you @ptrblck
class MyDataset(Dataset):
   def __init__(self, image_paths, dir, transform = None):
       self.image_paths = image_paths
       self.tranform = transform
       self.dir = dir

   def get_target_from_path(self,path):
       '''
       function that will return the target from the path
       '''
       # find the address of the rear sign
       rear = path.rfind('+')
       rear_ = path.rfind('-')
       if rear < rear_:
           rear = rear_

       # make the sign in to number sign that was just a string sign
       pm1 = pm2 = 1
       if path[13] == '-': pm1 = -1
       if path[rear] == '-': pm2 = -1

       v_ang = pm1 * int(path[14:rear])
       h_ang = pm2 * int(path[rear+1:len(path)-4])

       return v_ang, h_ang

   def __getitem__(self,index):
       # open the image file and get angle data from the filename
       image = Image.open(os.path.join(self.dir,self.image_paths[index]))
       v_ang, h_ang = self.get_target_from_path(self.image_paths[index])

       # transform the image
       if self.tranform:
           image = self.tranform(image)
       return image, v_ang, h_ang

   def __len__(self):
       #return the total number of dataset
       return len(self.image_paths)

I made the code like above.