predictor: jit-compile and precompile (non-autosized) models

This commit is contained in:
Robert Sachunsky 2026-04-13 01:17:04 +02:00
parent 01c54eb2ef
commit 56e6deb02c
2 changed files with 3 additions and 6 deletions

View file

@ -191,6 +191,9 @@ class EynollahModelZoo:
elif patched:
model = wrap_layout_model_patched(model)
model._name = model_category + '_patched'
else:
model.jit_compile = True
model.make_predict_function()
return model
def get(self, model_category: str) -> Predictor:

View file

@ -72,9 +72,6 @@ class wrap_layout_model_resized(models.Model):
(height, width))
return pred
def predict(self, x, verbose=0):
return self(x).numpy()
class wrap_layout_model_patched(models.Model):
"""
replacement for layout model using sliding window for patches
@ -157,6 +154,3 @@ class wrap_layout_model_patched(models.Model):
(height, width, self.classes))
pred = tf.expand_dims(pred, axis=0)
return pred
def predict(self, x, verbose=0):
return self(x).numpy()