mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-04-14 19:31:57 +02:00
predictor: jit-compile and precompile (non-autosized) models
This commit is contained in:
parent
01c54eb2ef
commit
56e6deb02c
2 changed files with 3 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue