Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template using pagination loads image only on page reload #4152

Closed
PaulHolocene opened this issue May 8, 2023 · 1 comment
Closed

template using pagination loads image only on page reload #4152

PaulHolocene opened this issue May 8, 2023 · 1 comment
Assignees

Comments

@PaulHolocene
Copy link

Describe the bug
I want to assign class labels to each PDF page. I'm storing a page image of each page in S3. My images from the S3 Bucket can be accessed without problems (Bucket policy and CORS are correctly set) and each image can be loaded without problems from a Browser tab via the ObjectUrl.
My labelling interface is defined as:

<View>
  <Repeater on="$images" indexFlag="{{idx}}" mode="pagination">
    <image name="page_{{idx}}" value="$images[{{idx}}].url" />
    <Choices name="labels_{{idx}}" toName="page_{{idx}}" showInline="true">
      <Choice value="Class-2" />
      <Choice value="Class-1" />
    </Choices>
  </Repeater>
</View>

Now I'm uploading a task.json like:

{'data': {'images': [{'url': 'https://labelstudio-holocene.s3.amazonaws.com/page_images/test_img_0.jpg'},
   {'url': 'https://labelstudio-holocene.s3.amazonaws.com/page_images/test_img_1.jpg'},
   {'url': 'https://labelstudio-holocene.s3.amazonaws.com/page_images/test_img_2.jpg'},
   {'url': 'https://labelstudio-holocene.s3.amazonaws.com/page_images/test_img_3.jpg'},
   {'url': 'https://labelstudio-holocene.s3.amazonaws.com/page_images/test_img_4.jpg'},
   {'url': 'https://labelstudio-holocene.s3.amazonaws.com/page_images/test_img_5.jpg'},
   {'url': 'https://labelstudio-holocene.s3.amazonaws.com/page_images/test_img_6.jpg'},],
  'file_id': '1oaZzu3f_dOf9WK-XMGdVVuPsvqjdGeT2',
  }

Now opening the uploaded task in labelstudio, I can see that the first page image is loaded (test_img_0.jpg). using the pagination button to navigate to page2 and all further pages will not load the images. The image of page 2 will only get loaded if I trigger a browser page refresh with page 2 tab activated. The image of page 3 will only get loaded with page 3 tab activated and triggering a page refresh....
after some time pages that were loaded disappear again e.g. I'm on page 5 and press page reload and previously loaded pages 3 and 4 that could be displayed before are now lost again.
The only page that can be always be displayed without problems is page 1.

console output on first page (no subsequent changes when using the paging):
Screenshot 2023-05-08 at 12 14 21

I read that the Repeater component is/will not be supported. Is there another workaround to get a template that can support me for my multi image classification task? I would be fine if all images are displayed/loaded at once (i.e. without pagination) and I can assign the class to each image. However the number of page images is different for each document, so I need somehow a dynamic component. I usually don't have more than 20 page images.

@PaulHolocene
Copy link
Author

issue is resolved. The paging component seems to load the new page image only when scrolled to the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants