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

Feature proposal: Add Line Region / Tag / Tool / Type / Result #6872

Open
maerteijn opened this issue Jan 8, 2025 · 1 comment
Open

Feature proposal: Add Line Region / Tag / Tool / Type / Result #6872

maerteijn opened this issue Jan 8, 2025 · 1 comment

Comments

@maerteijn
Copy link

maerteijn commented Jan 8, 2025

Reasoning
For one of our projects we need annotations which consist of a KeyPoint with a direction. Some would call it a geometric vector. The most practical way I found to implement this is with a dedicated Line Region with two points (or Arrow). The direction can then be easily calculated using the two points. With this POC I've created a new Line Region / Tag / Tool / Type and Result. ALine can be added to the editor with the dedicated control tag (including a configurable arrow flag):

 <View>
    <Line name="line" toName="image" arrow="true" />
    ....
</View>

The POC is demonstrated in the following video:

Line.Region.Demo.1080.h264.mov

Code
I've inspected the current Polygon Region / Tag / Tool / Type code, as a subset of the logic to draw polygons is also needed to draw lines. So the goal was to reuse as much code (for adding points, drag points etc) so that's what I tried to do. Some adjustments had to be made to the PolygonRegion, to make reuse possible. (As to be seen in this commit: maerteijn@e7ec3c6 )

The full implementation of the POC can be found here: https://github.com/maerteijn/label-studio/pull/2/commits

You can run the example by yourself:

  • Clone the fork and checkout the poc/add-editor-support-for-lines branch, then run cd web && npm run lsf:serve
  • Browse to http://localhost:3000 to test out the example.

Related
Related feature requests which this POC partly solves or at least makes it more easy to implement:

Feedback
Any feedback from the developers would be very welcome. And I'd like to know if there is a chance a PR with this will be accepted (when acceptance criteria are met like tests etc). if so, then I could prepare a PR with the Line functionality as desired.

@heidi-humansignal
Copy link
Collaborator

Hi there!

Thank you for your detailed proposal and for taking the time to develop a proof of concept (POC) for adding a Line region type to Label Studio. We appreciate your initiative and contribution to the project.
Feedback:
The ability to draw lines (or arrows) is a feature that has been requested by several users in the community, as seen in the related issues:

We greatly appreciate your feedback and the opportunity to consider your suggestion. Your request will be evaluated and ranked alongside other roadmap items. If our product team opts to proceed with your idea, we will keep you updated throughout the process. Please understand that while we take all requests seriously, we cannot promise implementation or a specific timeframe.

Thanks,

Tyler Conlee
Head of Support
HumanSignal

Comment by Tyler Conlee
Workflow Run

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

No branches or pull requests

2 participants