File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -230,13 +230,15 @@ Setting the `LAYOUT_BATCH_SIZE` env var properly will make a big difference when
230
230
from PIL import Image
231
231
from surya.detection import batch_text_detection
232
232
from surya.layout import batch_layout_detection
233
- from surya.model.layout.model import load_model, load_processor
233
+ from surya.model.detection.model import load_model as load_det_model, load_processor as load_det_processor
234
+ from surya.model.layout.model import load_model as load_layout_model
235
+ from surya.model.layout.processor import load_processor as load_layout_processor
234
236
235
237
image = Image.open(IMAGE_PATH )
236
- model = load_model ()
237
- processor = load_processor ()
238
- det_model = load_model ()
239
- det_processor = load_processor ()
238
+ model = load_layout_model ()
239
+ processor = load_layout_processor ()
240
+ det_model = load_det_model ()
241
+ det_processor = load_det_processor ()
240
242
241
243
# layout_predictions is a list of dicts, one per image
242
244
line_predictions = batch_text_detection([image], det_model, det_processor)
You can’t perform that action at this time.
0 commit comments