Skip to content
Snippets Groups Projects

Remove DPIAdjusting transform

Merged Manon Blanco requested to merge remove-dpi into main
All threads resolved!
6 files
+ 7
83
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 0
13
@@ -347,19 +347,6 @@ def apply_preprocessing(sample, preprocessings):
resize_ratio = [1, 1]
img = sample["img"]
for preprocessing in preprocessings:
if preprocessing["type"] == "dpi":
ratio = preprocessing["target"] / preprocessing["source"]
temp_img = img
h, w, c = temp_img.shape
temp_img = cv2.resize(
temp_img, (int(np.ceil(w * ratio)), int(np.ceil(h * ratio)))
)
if len(temp_img.shape) == 2:
temp_img = np.expand_dims(temp_img, axis=2)
img = temp_img
resize_ratio = [ratio, ratio]
if preprocessing["type"] == "to_grayscaled":
temp_img = img
h, w, c = temp_img.shape
Loading