Closed m-h-williams closed 1 month ago
Hi @m-h-williams,
Thanks for the suggestion; I agree that this would be a great addition. The Patch Extraction tool is an EXE, and I don't have access to the underlying code; however, it wouldn't be too difficult to whip something up in that replicates the utility. I also think it's about time to move towards a customizable patch annotation tool instead of solely relying on the former.
Before jumping into the code, in your mind, what features should be migrated / removed from the existing Patch Extraction tool, and also, what other features would you like to see in the new tool? Having a bigger picture of what is necessary / desired will help with scoping out the work. My thoughts are:
What else would you like to see?
Hi @Jordan-Pierce ,
Thanks for considering my suggestion and for your detailed thoughts on the new tool! The features you've outlined sound great and would significantly enhance the usability of the Patch Extraction tool.
As for additional features, here are my thoughts:
Patch Size and Label Customization: The ability to set patch sizes and customize labels with names and color codes (RGB) sounds perfect. The option to export and import label sets as JSON files would also be very useful for consistency across projects.
I'm thinking:
(for posterity)
This sounds fantastic! I'm really excited about these features and the flexibility they will bring to the tool.
It's great to hear that the image resolution will be read from the native image, allowing for zooming without down-sampling. The flexibility to set patch sizes based on specific needs and resolutions, and the option to have patches of different sizes in the same project, will be incredibly useful.
The toggle feature for turning labels on and off, including a master toggle, is a thoughtful addition. It will definitely help in managing annotations more effectively without overwhelming the view. I'm also looking forward to the annotation table for filtering and editing.
The plans for exporting and importing annotations sound comprehensive and will be a big help for managing datasets. I appreciate the consideration for future updates, like exporting subsets of annotations based on the table view.
Thank you for taking these suggestions into account and for the thoughtful planning. I'm excited to see these features come to life! Please feel free to reach out if there's anything I can do to help or support the development process.
@m-h-williams it's up if you wanna give it a go!
just remember to update:
# cmd
conda activate your_env
git fetch
git pull
python install.py
python toolbox.py
Please log any issues you have in this thread!
@Jordan-Pierce Thank you so much for the hard work you've put into the beta version of the new annotation tool—it's really coming together nicely!
I had a few thoughts and suggestions as I’ve been exploring it:
When clicking on a label in the lower label window, could it highlight the corresponding patch(es) with that label? I think this would make it easier to identify and manage specific patches.
I noticed we can delete a label, but I was wondering if there's a way to delete a single image patch for a label instead of all the patches for that label? I believe you mentioned this feature might be added later, and I think it would be really helpful. The upcoming addition of the ability to move patches will be a great enhancement as well!
It would also be helpful if the outline of a selected image patch were a brighter color. Right now, it matches the box color, making it a bit difficult to see.
The short code in the label window seems to be getting cut off after four characters, which makes it hard to read the full label.
It would be nice to have toggle on/off buttons for each label, along with a master toggle button. This way, we could start with all labels off and then turn them on one at a time to better see which labels need to be changed. Perhaps this was a feature you were thinking of adding later on as well.
When using the "Edit Label" function, it currently changes the label for all image patches with the previous label. It would be great if we could select an individual image patch, click "Edit Label," and change the label just for that specific patch. Additionally, after changing a label, hovering over the new label still shows the old label instead of the updated label (as shown in the screenshot below).
When using the "Add Label" button, it would be helpful if we could select where the image patch is placed. Currently, it seems to create the patch in the middle of the image, which might not be the ideal location.
Lastly, the add, edit, and delete label buttons above the label window are overlapping each other, as seen in the screenshot below.
Thanks again for all your efforts—I'm really excited to see these features evolve. Please let me know if there’s anything I can do to support your work!
@m-h-williams instructions! My bad: here they are, will add to repo next round:
The CoralNet Toolbox is a Python application built using PyQt5 for image annotation and analysis. This guide provides instructions on how to use the application, including key functionalities and hotkeys.
The main window consists of several components:
Import:
Export:
CoralNet:
Machine Learning:
When clicking on a label in the lower label window, could it highlight the corresponding patch(es) with that label? I think this would make it easier to identify and manage specific patches.
I noticed we can delete a label, but I was wondering if there's a way to delete a single image patch for a label instead of all the patches for that label? I believe you mentioned this feature might be added later, and I think it would be really helpful. The upcoming addition of the ability to move patches will be a great enhancement as well!
It would also be helpful if the outline of a selected image patch were a brighter color. Right now, it matches the box color, making it a bit difficult to see.
The short code in the label window seems to be getting cut off after four characters, which makes it hard to read the full label.
It would be nice to have toggle on/off buttons for each label, along with a master toggle button. This way, we could start with all labels off and then turn them on one at a time to better see which labels need to be changed. Perhaps this was a feature you were thinking of adding later on as well.
When using the "Edit Label" function, it currently changes the label for all image patches with the previous label.
Yes intended.
It would be great if we could select an individual image patch, click "Edit Label," and change the label just for that specific patch.
See comment above about using the selector tool to select an individual annotation and changing the label for just it using the tool on the label in the label window / or with hot keys (cntrl + wasd)
Additionally, after changing a label, hovering over the new label still shows the old label instead of the updated label (as shown in the screenshot below).
When using the "Add Label" button, it would be helpful if we could select where the image patch is placed. Currently, it seems to create the patch in the middle of the image, which might not be the ideal location.
Lastly, the add, edit, and delete label buttons above the label window are overlapping each other, as seen in the screenshot below.
Regarding resolution, can confirm that it needs to update scaling dynamically; these are my settings
If I choose anything less than 150 on a larger monitor it displays as intended. Will have a better fix in the future
@m-h-williams another update if you wanna give it a try; not all has been addressed, but added new stuff and fixed others.
@Jordan-Pierce This is already a fantastic improvement! The confidence window is incredibly helpful for quickly viewing what an image patch looks like. The different colors when a patch is highlighted make it much easier to manage annotations, and the ability to move patches around works seamlessly—this really enhances the annotation process.
The overlap of the edit tabs and the cutoff labels was indeed a scaling issue on my computer. I have a 4K screen, but even without adjusting the scaling, the labels are now much easier to read. Thank you for addressing that!
I have a few more suggestions that I think could further enhance the tool:
Importing Label Sets: Could we add an option to import a label set so that all the label options are pre-loaded in the label window? This would help reduce the chance of typos when adding new annotations, ensuring consistency across different images.
Hotkeys for Scrolling Through Image Patches: The hotkeys for scrolling through labels are great! It would be awesome if we could also use hot keys to scroll through the image patches of a selected label. My thought is that when a label is selected, you could use the confidence window to quickly check each annotation, delete it if it's incorrect, and then automatically move to the next image patch with the same label. Or, if the label is correct, you could use a hot key to move to the next patch. I think this would make cleaning annotations much faster than selecting each image patch one at a time.
Selecting and Deleting Multiple Patches: Could we add a feature that allows users to select multiple patches at once—perhaps by dragging the mouse over them—and then delete or rename the group? For example, in the screenshot below, algae has been incorrectly labeled as pebble. It would be really helpful if we could select these patches in bulk and delete/correct them all at once.
Thank you again for your hard work on these updates! These improvements have already made a big difference.
Importing Label Sets: Could we add an option to import a label set so that all the label options are pre-loaded in the label window? This would help reduce the chance of typos when adding new annotations, ensuring consistency across different images.
Hotkeys for Scrolling Through Image Patches: The hotkeys for scrolling through labels are great! It would be awesome if we could also use hot keys to scroll through the image patches of a selected label. My thought is that when a label is selected, you could use the confidence window to quickly check each annotation, delete it if it's incorrect, and then automatically move to the next image patch with the same label. Or, if the label is correct, you could use a hot key to move to the next patch. I think this would make cleaning annotations much faster than selecting each image patch one at a time.
Selecting and Deleting Multiple Patches: Could we add a feature that allows users to select multiple patches at once—perhaps by dragging the mouse over them—and then delete or rename the group? For example, in the screenshot below, algae has been incorrectly labeled as pebble. It would be really helpful if we could select these patches in bulk and delete/correct them all at once.
Will let you know when ML is out.
Thanks, @Jordan-Pierce ! The import/export feature for label sets is what I was looking for. The future plans you mentioned, like importing labels from CoralNet and defining a "Project" for saving everything together, sound like great improvements that will streamline the workflow even further.
Very excited to hear that hotkeys for scrolling through image patches and adjusting labels within the confidence window are on the way. And having hotkeys for navigating through thumbnails will definitely speed up the process — great idea!
The upcoming multi-select feature will be a great improvement, especially when dealing with large datasets. I totally understand that it requires some reworking of the existing setup, but I’m really looking forward to it when it’s ready.
One quick question: When creating new labels, how do I ensure I’m generating the correct unique ID for them? I noticed the IDs in the JSON file are quite specific, and I want to make sure I’m doing it correctly.
Thanks again, I'm really excited to see these new features roll out!
One quick question: When creating new labels, how do I ensure I’m generating the correct unique ID for them? I noticed the IDs in the JSON file are quite specific, and I want to make sure I’m doing it correctly.
@m-h-williams machine learning has been added.; might be useful to go over it via a call but briefly:
To use a model; you have three options:
Predictions will show in the confidence window when the annotation is selected (if you move or adjust their size, you'll get a warning, as once you change a prediction, it doesn't really hold true anymore). I recommend switching to left hand on cntrl + arrows, and right hand on mouse. Use cntrl + left / right to cycle through all annotation on an image, and use the mouse to select any of the predicted categories, or any other label in the label window. To switch to the next image, do cntrl + up / down.
Last thing to note is the model: still with the smallest (tiny / t) model, and you can train even on a CPU in a reasonable amount of time, and inference is fast. The models are coming from ultralytics, so please make yourself familiar with their license.
@Jordan-Pierce I used the machine learning option in the annotate tool, and it worked great! I’d love to set up a call to go over it in more detail. I’ll email you to arrange a time.
I have a couple of small suggestions:
Could we have the option to specify where we want the model to be saved? I was able to define the locations for the test, train, and validation folders during training, but the model itself was saved elsewhere—specifically, in your GitHub repo under /Data/Training/. It would be really helpful if we could choose the save location for the model, just like we can specify the name of the folder for training.
Additionally, it would be great if we could also specify the model name when saving it.
I'll definitely familiarize myself with the models from Ultralytics and their license. If there’s anything else I should be aware of or any additional resources you recommend, please let me know.
Thanks again for all the work you’ve put into these updates!
Hello Jordan,
I have a suggestion for a useful addition to the CoralNet Toolbox. It would be great to have a feature that allows users to delete patches created using the Patch Extractor Tool and subsequently generate a new patches CSV file. This new CSV file could then be used to train a classifier.
The ability to extract patches from an annotation file is incredibly helpful for visualizing the patches associated with specific labels. However, during this process with my source, I noticed some erroneous patches that I wanted to remove to clean up the annotations. While I can manually delete these patches from the folder on my computer, this doesn't update the annotation file or create a new patches file. I find that this hinders the ability to train a classifier with the cleaned data.
Adding this feature could streamline the process and enhance the utility of the toolbox for users like myself who need to refine their data before training classifiers.
Perhaps there is a work around with the current tools that I am not thinking of. What do you think?
Megan