augmentations for 16bit grayscaled
This commit is contained in:
@ -53,7 +53,7 @@ class DetectionTrainer(BaseTrainer):
|
||||
|
||||
def preprocess_batch(self, batch):
|
||||
"""Preprocesses a batch of images by scaling and converting to float."""
|
||||
batch['img'] = batch['img'].to(self.device, non_blocking=True).float() / 255
|
||||
batch['img'] = batch['img'].to(self.device, non_blocking=True).float() / 65535.0 # uint16 to float16
|
||||
return batch
|
||||
|
||||
def set_model_attributes(self):
|
||||
|
@ -44,7 +44,7 @@ class DetectionValidator(BaseValidator):
|
||||
def preprocess(self, batch):
|
||||
"""Preprocesses batch of images for YOLO training."""
|
||||
batch['img'] = batch['img'].to(self.device, non_blocking=True)
|
||||
batch['img'] = (batch['img'].half() if self.args.half else batch['img'].float()) / 255
|
||||
batch['img'] = (batch['img'].half() if self.args.half else batch['img'].float()) / 65535.0 # uint16 to float16
|
||||
for k in ['batch_idx', 'cls', 'bboxes']:
|
||||
batch[k] = batch[k].to(self.device)
|
||||
|
||||
|
Reference in New Issue
Block a user