Daniellesry commited on
Commit
3d834fd
·
1 Parent(s): ef768e9
Files changed (1) hide show
  1. dkt/pipelines/pipeline.py +5 -1
dkt/pipelines/pipeline.py CHANGED
@@ -991,7 +991,11 @@ class DKTPipeline:
991
 
992
  if iidx == 0:
993
  # Read the input image and convert to tensor (3, H, W) with RGB values normalized to [0, 1]
994
- input_image = torch.tensor(input_image_np / 255, dtype=torch.float32, device=moge_device).permute(2, 0, 1)
 
 
 
 
995
  print(f'moge devices: {moge_device}')
996
 
997
  output = self.moge_pipe.infer(input_image)
 
991
 
992
  if iidx == 0:
993
  # Read the input image and convert to tensor (3, H, W) with RGB values normalized to [0, 1]
994
+ if input_image_np.max() > 1:
995
+ input_image = torch.tensor(input_image_np / 255, dtype=torch.float16, device=moge_device).permute(2, 0, 1)
996
+ else:
997
+ input_image = torch.tensor(input_image_np, dtype=torch.float16, device=moge_device).permute(2, 0, 1)
998
+
999
  print(f'moge devices: {moge_device}')
1000
 
1001
  output = self.moge_pipe.infer(input_image)