Skip to content

Just trying to do bounding box with labels to save images for a Flux LoRA training an got carried away...

License

Notifications You must be signed in to change notification settings

diodiogod/Fast_labels_boxes_and_arrows

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast Labels: Boxes & Arrows

Description

Well, I could not find any annotators that would be fast to use and let me download the image with the bounding boxes AND labels. So I forked this project to improve it for my needs with the helps of ChatGPT. I'm not a coder. Now it does arrows too! action

For windows, install Python, do the venv thing:

python -m venv env

Activate the venv thing:

env\Scripts\activate

Install

  • Install Flask
pip install Flask

Getting started

  • cd into this directory after cloning the repo
  • start the app Example:
python app.py "D:\YourFolderWithImages"

You don't need to specify a output file, it will check and create automatically on the loaded folder.

Output

  • The output is to a csv file with the following fields
    • image - image the bounding box is associated with
    • id - id of the bounding box within the image
    • name - Label name of the bounding box
    • xMin - min x value of the bounding box
    • xMax - max x value of the bounding box
    • yMin - min y value of the bounding box
    • yMax - max y value of the bounding box
    • Color - hex clor value of the bounding box
    • Type - Box or Arrow annotation
    • xOffset - individual label name xoffset (used to move it)
    • yOffset - individual label name yoffset (used to move it)

What is new to my project:

  • Arrows!
  • Colors
  • Labels on top of each bounding box
  • Label cycling for fast labeling images in the same order
  • Predefined labels and colors
  • You can zoom with slider or mouse wheel.
  • You can drag the image through the canvas and zoom freely
  • Button to reset zoom to 100% (and also reset image back to starting position)
  • Button to save image (it will save at 100% zoom with bounding boxes and Labels, this is what I wanted for this project)
  • CSV is automatically created on the image directory as annotations.cvs with all images annotations as you go. This is a bonus, I don't have a use for this, but it is used to save and restore the session.
  • Save and restoring working session.
  • Next and previously with persistent annotations.
  • Button to save CSV (it will get a download copy of the CVS)
  • A new tab to change (and it will persist) the rotating predefined labels and predefined colors (add, remove, change colors)
  • On the "Predefined labels" tab you can find some settings: Label font size %, Label Offset, Label Font Style, Reset to Defaults, Arrow head size, Arrow type (standard or triangle).
  • A crosshair while hoovering the image.
  • Adjust line Width (persistent).
  • A Side pannel resizer (persistent)
  • You can move freely the individual label name by simply dragging it.
  • You can also adjust both bounding boxes or arrows coordinates.
  • Save all images with annotations (zip file)
  • "Fit" image to screen button.

What is Missing/problems?

  • First screen sometimes is blank, you need to move to the next image.
  • Sometimes with Firefox on fullscreen some images might not fit the canvas. You can either go to the next and back or "fit" to screen. Could not fix this. Edge doesn't have this bug.

Future:

  • Drag and Drop with a shadow to create bounding boxes and also keep the two coordinates point click.
  • Maybe fix the goodbye screen at the end.
  • Do a intro screen

About

Just trying to do bounding box with labels to save images for a Flux LoRA training an got carried away...

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 86.1%
  • Python 13.9%