Bug: limit_side_len and limit_type=max cannot be set at a time
Author: fzemiCreated Sep 18, 2026Updated Sep 18, 2026
Problem Description
It is not possible to get limit_side_len and limit_type=max working at the same time. When limit_type is set to max it doesn't matter to what value we set limit_side_len, because it gets ignored by this code:
def get_preprocess(self, max_wh: int) -> DetPreProcess:
if self.limit_type == "min":
limit_side_len = self.limit_side_len
elif max_wh < 960:
limit_side_len = 960
elif max_wh < 1500:
limit_side_len = 1500
else:
limit_side_len = 2000
return DetPreProcess(limit_side_len, self.limit_type, self.mean, self.std)There should be a way to set them both. When setting for example limit_side_len=960 and limit_type=max with the image of 2000x2000px we are passing the original image to the detector instead of the resized one to 960x960px
Source: RapidAI/RapidOCR