trocr viarant for Predictor runtime: no model size for input_shape…

Because transformers v4 and v5 API for image preprocessor differs,
and the model-internal image input sizes are actually irrelevant,
because the preprocessor will resize them anyway, and there is no
batch dimension (because the input images will have different shapes),
do not advertise this information in `.input_shape`.
This commit is contained in:
Robert Sachunsky 2026-06-03 20:51:56 +02:00
parent f447a9f248
commit 4e7e1c06b9

View file

@ -379,9 +379,9 @@ class EynollahModelZoo:
return text, conf return text, conf
model.predict_on_batch = predict_torch model.predict_on_batch = predict_torch
# not actually needed (image processor does resize itself) # not actually needed (image processor does resize itself)
# no batch dimension (images passed as list w/ varying shapes)
model.input_shape = (None, model.input_shape = (None,
proc.image_processor.size.height, None,
proc.image_processor.size.width,
len(proc.image_processor.image_mean)) len(proc.image_processor.image_mean))
return model return model