From f6f89b8ce7976db4391034386c6041dd12411642 Mon Sep 17 00:00:00 2001
From: Yoann Schneider <yschneider@teklia.com>
Date: Thu, 9 Nov 2023 18:24:27 +0100
Subject: [PATCH] use cv2.INTER_AREA interpolation

---
 dan/ocr/transforms.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dan/ocr/transforms.py b/dan/ocr/transforms.py
index d9b80c6a..3a8c74f6 100644
--- a/dan/ocr/transforms.py
+++ b/dan/ocr/transforms.py
@@ -6,6 +6,7 @@ from enum import Enum
 from random import randint
 
 import albumentations as A
+import cv2
 import numpy as np
 from albumentations.augmentations import (
     Affine,
@@ -190,7 +191,9 @@ def get_augmentation_transforms() -> A.Compose:
     return A.Compose(
         [
             # Scale between 0.75 and 1.0
-            RandomScale(scale_limit=[-0.25, 0], always_apply=True),
+            RandomScale(
+                scale_limit=[-0.25, 0], always_apply=True, interpolation=cv2.INTER_AREA
+            ),
             A.SomeOf(
                 [
                     ErosionDilation(min_kernel=1, max_kernel=4, iterations=1),
-- 
GitLab