@@ -128,28 +128,28 @@ class _InputFields(Generic[T, ImageT, MaskT, PathT], ABC):
128128 methods.
129129 """
130130
131- image : FieldDescriptor [ImageT ] = FieldDescriptor (validator_name = "_validate_image " )
132- gt_label : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "_validate_gt_label " )
133- gt_mask : FieldDescriptor [MaskT | None ] = FieldDescriptor (validator_name = "_validate_gt_mask " )
134- mask_path : FieldDescriptor [PathT | None ] = FieldDescriptor (validator_name = "_validate_mask_path " )
131+ image : FieldDescriptor [ImageT ] = FieldDescriptor (validator_name = "validate_image " )
132+ gt_label : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "validate_gt_label " )
133+ gt_mask : FieldDescriptor [MaskT | None ] = FieldDescriptor (validator_name = "validate_gt_mask " )
134+ mask_path : FieldDescriptor [PathT | None ] = FieldDescriptor (validator_name = "validate_mask_path " )
135135
136136 @abstractmethod
137- def _validate_image (self , image : ImageT ) -> ImageT :
137+ def validate_image (self , image : ImageT ) -> ImageT :
138138 """Validate the image."""
139139 raise NotImplementedError
140140
141141 @abstractmethod
142- def _validate_gt_mask (self , gt_mask : MaskT ) -> MaskT | None :
142+ def validate_gt_mask (self , gt_mask : MaskT ) -> MaskT | None :
143143 """Validate the ground truth mask."""
144144 raise NotImplementedError
145145
146146 @abstractmethod
147- def _validate_mask_path (self , mask_path : PathT ) -> PathT | None :
147+ def validate_mask_path (self , mask_path : PathT ) -> PathT | None :
148148 """Validate the mask path."""
149149 raise NotImplementedError
150150
151151 @abstractmethod
152- def _validate_gt_label (self , gt_label : T ) -> T | None :
152+ def validate_gt_label (self , gt_label : T ) -> T | None :
153153 """Validate the ground truth label."""
154154 raise NotImplementedError
155155
@@ -163,7 +163,7 @@ class _ImageInputFields(Generic[PathT], ABC):
163163 with disk-stored image datasets, facilitating custom data loading strategies.
164164
165165 The ``image_path`` field uses a ``FieldDescriptor`` with a validation method.
166- Subclasses must implement ``_validate_image_path `` to ensure path validity
166+ Subclasses must implement ``validate_image_path `` to ensure path validity
167167 according to specific Anomalib model or dataset requirements.
168168
169169 This class is designed to complement ``_InputFields`` for comprehensive
@@ -172,7 +172,7 @@ class _ImageInputFields(Generic[PathT], ABC):
172172 Examples:
173173 Assuming a concrete implementation ``DummyImageInput``:
174174 >>> class DummyImageInput(_ImageInputFields):
175- ... def _validate_image_path (self, image_path):
175+ ... def validate_image_path (self, image_path):
176176 ... return image_path # Implement actual validation
177177 ... # Implement other required methods
178178
@@ -190,10 +190,10 @@ class _ImageInputFields(Generic[PathT], ABC):
190190 methods.
191191 """
192192
193- image_path : FieldDescriptor [PathT | None ] = FieldDescriptor (validator_name = "_validate_image_path " )
193+ image_path : FieldDescriptor [PathT | None ] = FieldDescriptor (validator_name = "validate_image_path " )
194194
195195 @abstractmethod
196- def _validate_image_path (self , image_path : PathT ) -> PathT | None :
196+ def validate_image_path (self , image_path : PathT ) -> PathT | None :
197197 """Validate the image path."""
198198 raise NotImplementedError
199199
@@ -217,7 +217,7 @@ class _VideoInputFields(Generic[T, ImageT, MaskT, PathT], ABC):
217217 Assuming a concrete implementation ``DummyVideoInput``:
218218
219219 >>> class DummyVideoInput(_VideoInputFields):
220- ... def _validate_original_image (self, original_image):
220+ ... def validate_original_image (self, original_image):
221221 ... return original_image # Implement actual validation
222222 ... # Implement other required methods
223223
@@ -243,34 +243,34 @@ class _VideoInputFields(Generic[T, ImageT, MaskT, PathT], ABC):
243243 methods.
244244 """
245245
246- original_image : FieldDescriptor [ImageT | None ] = FieldDescriptor (validator_name = "_validate_original_image " )
247- video_path : FieldDescriptor [PathT | None ] = FieldDescriptor (validator_name = "_validate_video_path " )
248- target_frame : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "_validate_target_frame " )
249- frames : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "_validate_frames " )
250- last_frame : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "_validate_last_frame " )
246+ original_image : FieldDescriptor [ImageT | None ] = FieldDescriptor (validator_name = "validate_original_image " )
247+ video_path : FieldDescriptor [PathT | None ] = FieldDescriptor (validator_name = "validate_video_path " )
248+ target_frame : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "validate_target_frame " )
249+ frames : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "validate_frames " )
250+ last_frame : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "validate_last_frame " )
251251
252252 @abstractmethod
253- def _validate_original_image (self , original_image : ImageT ) -> ImageT | None :
253+ def validate_original_image (self , original_image : ImageT ) -> ImageT | None :
254254 """Validate the original image."""
255255 raise NotImplementedError
256256
257257 @abstractmethod
258- def _validate_video_path (self , video_path : PathT ) -> PathT | None :
258+ def validate_video_path (self , video_path : PathT ) -> PathT | None :
259259 """Validate the video path."""
260260 raise NotImplementedError
261261
262262 @abstractmethod
263- def _validate_target_frame (self , target_frame : T ) -> T | None :
263+ def validate_target_frame (self , target_frame : T ) -> T | None :
264264 """Validate the target frame."""
265265 raise NotImplementedError
266266
267267 @abstractmethod
268- def _validate_frames (self , frames : T ) -> T | None :
268+ def validate_frames (self , frames : T ) -> T | None :
269269 """Validate the frames."""
270270 raise NotImplementedError
271271
272272 @abstractmethod
273- def _validate_last_frame (self , last_frame : T ) -> T | None :
273+ def validate_last_frame (self , last_frame : T ) -> T | None :
274274 """Validate the last frame."""
275275 raise NotImplementedError
276276
@@ -293,9 +293,9 @@ class _DepthInputFields(Generic[T, PathT], _ImageInputFields[PathT], ABC):
293293 Assuming a concrete implementation ``DummyDepthInput``:
294294
295295 >>> class DummyDepthInput(_DepthInputFields):
296- ... def _validate_depth_map (self, depth_map):
296+ ... def validate_depth_map (self, depth_map):
297297 ... return depth_map # Implement actual validation
298- ... def _validate_depth_path (self, depth_path):
298+ ... def validate_depth_path (self, depth_path):
299299 ... return depth_path # Implement actual validation
300300 ... # Implement other required methods
301301
@@ -316,16 +316,16 @@ class _DepthInputFields(Generic[T, PathT], _ImageInputFields[PathT], ABC):
316316 methods.
317317 """
318318
319- depth_map : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "_validate_depth_map " )
320- depth_path : FieldDescriptor [PathT | None ] = FieldDescriptor (validator_name = "_validate_depth_path " )
319+ depth_map : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "validate_depth_map " )
320+ depth_path : FieldDescriptor [PathT | None ] = FieldDescriptor (validator_name = "validate_depth_path " )
321321
322322 @abstractmethod
323- def _validate_depth_map (self , depth_map : ImageT ) -> ImageT | None :
323+ def validate_depth_map (self , depth_map : ImageT ) -> ImageT | None :
324324 """Validate the depth map."""
325325 raise NotImplementedError
326326
327327 @abstractmethod
328- def _validate_depth_path (self , depth_path : PathT ) -> PathT | None :
328+ def validate_depth_path (self , depth_path : PathT ) -> PathT | None :
329329 """Validate the depth path."""
330330 raise NotImplementedError
331331
@@ -345,13 +345,13 @@ class _OutputFields(Generic[T, MaskT], ABC):
345345 Assuming a concrete implementation ``DummyOutput``:
346346
347347 >>> class DummyOutput(_OutputFields):
348- ... def _validate_anomaly_map (self, anomaly_map):
348+ ... def validate_anomaly_map (self, anomaly_map):
349349 ... return anomaly_map # Implement actual validation
350- ... def _validate_pred_score (self, pred_score):
350+ ... def validate_pred_score (self, pred_score):
351351 ... return pred_score # Implement actual validation
352- ... def _validate_pred_mask (self, pred_mask):
352+ ... def validate_pred_mask (self, pred_mask):
353353 ... return pred_mask # Implement actual validation
354- ... def _validate_pred_label (self, pred_label):
354+ ... def validate_pred_label (self, pred_label):
355355 ... return pred_label # Implement actual validation
356356
357357 >>> # Create an output instance with predictions
@@ -374,28 +374,28 @@ class _OutputFields(Generic[T, MaskT], ABC):
374374 methods.
375375 """
376376
377- anomaly_map : FieldDescriptor [MaskT | None ] = FieldDescriptor (validator_name = "_validate_anomaly_map " )
378- pred_score : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "_validate_pred_score " )
379- pred_mask : FieldDescriptor [MaskT | None ] = FieldDescriptor (validator_name = "_validate_pred_mask " )
380- pred_label : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "_validate_pred_label " )
377+ anomaly_map : FieldDescriptor [MaskT | None ] = FieldDescriptor (validator_name = "validate_anomaly_map " )
378+ pred_score : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "validate_pred_score " )
379+ pred_mask : FieldDescriptor [MaskT | None ] = FieldDescriptor (validator_name = "validate_pred_mask " )
380+ pred_label : FieldDescriptor [T | None ] = FieldDescriptor (validator_name = "validate_pred_label " )
381381
382382 @abstractmethod
383- def _validate_anomaly_map (self , anomaly_map : MaskT ) -> MaskT | None :
383+ def validate_anomaly_map (self , anomaly_map : MaskT ) -> MaskT | None :
384384 """Validate the anomaly map."""
385385 raise NotImplementedError
386386
387387 @abstractmethod
388- def _validate_pred_score (self , pred_score : T ) -> T | None :
388+ def validate_pred_score (self , pred_score : T ) -> T | None :
389389 """Validate the predicted score."""
390390 raise NotImplementedError
391391
392392 @abstractmethod
393- def _validate_pred_mask (self , pred_mask : MaskT ) -> MaskT | None :
393+ def validate_pred_mask (self , pred_mask : MaskT ) -> MaskT | None :
394394 """Validate the predicted mask."""
395395 raise NotImplementedError
396396
397397 @abstractmethod
398- def _validate_pred_label (self , pred_label : T ) -> T | None :
398+ def validate_pred_label (self , pred_label : T ) -> T | None :
399399 """Validate the predicted label."""
400400 raise NotImplementedError
401401
@@ -477,7 +477,7 @@ class _GenericItem(
477477 Assuming a concrete implementation ``DummyItem``:
478478
479479 >>> class DummyItem(_GenericItem):
480- ... def _validate_image (self, image):
480+ ... def validate_image (self, image):
481481 ... return image # Implement actual validation
482482 ... # Implement other required methods
483483
@@ -522,7 +522,7 @@ class _GenericBatch(
522522 Assuming a concrete implementation ``DummyBatch``:
523523
524524 >>> class DummyBatch(_GenericBatch):
525- ... def _validate_image (self, image):
525+ ... def validate_image (self, image):
526526 ... return image # Implement actual validation
527527 ... # Implement other required methods
528528
0 commit comments