HumanSignal / HumanSignal/label-studio
Bounding boxes shifted after importing JSON into Label Studio
- Dominant language
- TypeScript
- Stars
- 28.3k
- Forks
- 3.7k
- Avg merge
- 14h
- Merged PRs (30d)
- 15
Description
**Describe the bug**
I segment objects in a video using SAM2 in a Jupyter Notebook. I convert the segmentations into bboxes using masks_to_boxes(). Then I translate the generated bboxes into a .json file that will be imported into Label Studio. After that, I configure the Label Studio template for Object Tracking. And when I checked, the bboxes are displayed with an unrealistic offset.
Unrealistic? How do I know that? Because I export them back. I only use Label Studio to make adjustments not captured by SAM2. And perfect segmentations are shown with shifted bboxes, even though the coordinates remain the same as when imported.
**To Reproduce**
Steps to reproduce the behavior:
1. Open Label Studio
2. Create a project in Label Studio
3. Configure and enable Local Storage
4. Import the .json (video path + bboxes for each frame)
5. Compare the bounding box drawn in Label Studio with the one drawn in an image software using the coordinates obtained by masks_to_boxes() on that imported image.
**Screenshots**
The image on the left is the shifted one, the one on the right is generated by Inkscape using the bounding box coordinates, it's the correct image. (It's a helmet of construction)
**Environment (please complete the following information):**
- Debian 12
- Label Studio 1.20.0
PS: I have already exported the coordinates from Label Studio and they remain the same.
Contributor guide
Assessment
This issue has not been assessed yet.