Dimitri Korsch 6 лет назад
Родитель
Сommit
fce3da4da2
1 измененных файлов с 3 добавлено и 6 удалено
  1. 3 6
      nabirds/dataset/part.py

+ 3 - 6
nabirds/dataset/part.py

@@ -77,11 +77,6 @@ class BasePart(ABC):
 		else:
 			raise ValueError("Unknown part annotation format: {}".format(annotation))
 
-
-	@abstractmethod
-	def __init__(self, *args, **kwargs):
-		raise NotImplementedError
-
 	def rescale(self, image, annotation, rescale_size):
 		if rescale_size is not None and rescale_size > 0:
 			h, w, c = utils.dimensions(image)
@@ -125,8 +120,9 @@ class LocationPart(BasePart):
 	DEFAULT_RATIO = np.sqrt(49 / 400) # 0.35
 
 	def __init__(self, image, annotation, rescale_size):
-		annotation = self.rescale(image, annotation, rescale_size)
+		super(LocationPart, self).__init__()
 
+		annotation = self.rescale(image, annotation, rescale_size)
 		# here x,y are the center of the part
 		self._id, self.x, self.y, self.is_visible = annotation
 		self._ratio = LocationPart.DEFAULT_RATIO
@@ -164,6 +160,7 @@ class LocationPart(BasePart):
 class BBoxPart(BasePart):
 
 	def __init__(self, image, annotation, rescale_size):
+		super(BBoxPart, self).__init__()
 
 		annotation = self.rescale(image, annotation, rescale_size)
 		# here x,y are top left corner of the part