فهرست منبع

saving image uuid in the ImageWrapper object

Dimitri Korsch 4 سال پیش
والد
کامیت
7089c8fbf8
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 2 0
      cvdatasets/dataset/image/image_wrapper.py
  2. 2 1
      cvdatasets/dataset/mixins/reading.py

+ 2 - 0
cvdatasets/dataset/image/image_wrapper.py

@@ -20,11 +20,13 @@ class ImageWrapper(object):
 	def __init__(self, im_path, label,
 		parts=None,
 		mode="RGB",
+		uuid=None,
 		part_rescale_size=None,
 		part_surrogate_type=SurrogateType.MIDDLE,
 		center_cropped=True):
 
 		self.mode = mode
+		self.uuid = uuid
 		self._im = None
 		self._im_array = None
 

+ 2 - 1
cvdatasets/dataset/mixins/reading.py

@@ -31,6 +31,7 @@ class AnnotationsReadMixin(BaseMixin):
 
 		return ImageWrapper(im_path, int(label), parts,
 			mode=self.mode,
+			uuid=i,
 			part_rescale_size=self.part_rescale_size,
 			center_cropped=self.center_cropped)
 
@@ -62,7 +63,7 @@ class ImageListReadingMixin(BaseMixin):
 		im_file, label = self._pairs[i]
 		im_path = join(self._root, im_file)
 
-		return ImageWrapper(im_path, int(label))
+		return ImageWrapper(im_path, int(label), uuid=i)
 
 	@property
 	def labels(self):