|  | @@ -43,12 +43,12 @@ class LabelFile(object):
 | 
											
												
													
														|  |          try:
 |  |          try:
 | 
											
												
													
														|  |              with open(filename, 'rb' if PY2 else 'r') as f:
 |  |              with open(filename, 'rb' if PY2 else 'r') as f:
 | 
											
												
													
														|  |                  data = json.load(f)
 |  |                  data = json.load(f)
 | 
											
												
													
														|  | -                imagePath = data['imagePath']
 |  | 
 | 
											
												
													
														|  |                  if data['imageData'] is not None:
 |  |                  if data['imageData'] is not None:
 | 
											
												
													
														|  |                      imageData = b64decode(data['imageData'])
 |  |                      imageData = b64decode(data['imageData'])
 | 
											
												
													
														|  |                  else:
 |  |                  else:
 | 
											
												
													
														|  | -                    imagePath = os.path.join(
 |  | 
 | 
											
												
													
														|  | -                        os.path.dirname(filename), data['imagePath'])
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    # relative path from label file to relative path from cwd
 | 
											
												
													
														|  | 
 |  | +                    imagePath = os.path.join(os.path.dirname(filename),
 | 
											
												
													
														|  | 
 |  | +                                             data['imagePath'])
 | 
											
												
													
														|  |                      with open(imagePath, 'rb') as f:
 |  |                      with open(imagePath, 'rb') as f:
 | 
											
												
													
														|  |                          imageData = f.read()
 |  |                          imageData = f.read()
 | 
											
												
													
														|  |                  lineColor = data['lineColor']
 |  |                  lineColor = data['lineColor']
 | 
											
										
											
												
													
														|  | @@ -57,7 +57,7 @@ class LabelFile(object):
 | 
											
												
													
														|  |                          for s in data['shapes'])
 |  |                          for s in data['shapes'])
 | 
											
												
													
														|  |                  # Only replace data after everything is loaded.
 |  |                  # Only replace data after everything is loaded.
 | 
											
												
													
														|  |                  self.shapes = shapes
 |  |                  self.shapes = shapes
 | 
											
												
													
														|  | -                self.imagePath = imagePath
 |  | 
 | 
											
												
													
														|  | 
 |  | +                self.imagePath = data['imagePath']
 | 
											
												
													
														|  |                  self.imageData = imageData
 |  |                  self.imageData = imageData
 | 
											
												
													
														|  |                  self.lineColor = lineColor
 |  |                  self.lineColor = lineColor
 | 
											
												
													
														|  |                  self.fillColor = fillColor
 |  |                  self.fillColor = fillColor
 |