You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys, I met this problem when trying to perform layout analysis in batches with the sample code in README. I guess this may because img_counts has become list of list when using multiple images as input.
I am running this code in Jupyter notebook in vscode, using M4Pro MacBook, macOS Squoia 15.2. Python 3.11.
Thanks in advance!
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[17], line 16
14 # layout_predictions is a list of dicts, one per image
15 line_predictions = batch_text_detection(imgs[:2], det_model, det_processor)
---> 16 layout_predictions = batch_layout_detection(imgs[:2], model, processor, line_predictions)
18 layout_predictions
File /opt/miniconda3/envs/fin-rag/lib/python3.11/site-packages/surya/layout.py:80, in batch_layout_detection(images, model, processor, batch_size, top_k)
77 end_idx = 1
78 while end_idx < len(img_counts):
79 if any([
---> 80 sum(img_counts[start_idx:end_idx]) >= batch_size,
81 sum(img_counts[start_idx:end_idx + 1]) > batch_size,
82 ]):
83 batches.append((start_idx, end_idx))
84 start_idx = end_idx
TypeError: '>=' not supported between instances of 'int' and 'list'
The text was updated successfully, but these errors were encountered:
Hi guys, I met this problem when trying to perform layout analysis in batches with the sample code in README. I guess this may because
img_counts
has become list of list when using multiple images as input.I am running this code in Jupyter notebook in vscode, using M4Pro MacBook, macOS Squoia 15.2. Python 3.11.
Thanks in advance!
The text was updated successfully, but these errors were encountered: