neverix commited on
Commit
e6d263a
1 Parent(s): 63bce98

High bit depth

Browse files
Files changed (1) hide show
  1. data_loader.py +1 -1
data_loader.py CHANGED
@@ -226,7 +226,7 @@ class FileDataset(Dataset):
226
  if "labels" in sample:
227
  # return UDP as 4chn XYZV float tensor
228
  if sample["labels"].dtype != np.float32:
229
- sample["labels"] = sample["labels"].astype(np.float32) / 255
230
  sample["labels"] = torch.from_numpy(
231
  sample["labels"].transpose((2, 0, 1)))
232
  assert (sample["labels"].dtype == torch.float32)
 
226
  if "labels" in sample:
227
  # return UDP as 4chn XYZV float tensor
228
  if sample["labels"].dtype != np.float32:
229
+ sample["labels"] = sample["labels"].astype(np.float32) / np.iinfo(sample["labels"].dtype).max
230
  sample["labels"] = torch.from_numpy(
231
  sample["labels"].transpose((2, 0, 1)))
232
  assert (sample["labels"].dtype == torch.float32)