-
Notifications
You must be signed in to change notification settings - Fork 52
Crop editor #353
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
base: main
Are you sure you want to change the base?
Crop editor #353
Conversation
281bf29
to
c47ab95
Compare
Still missing: - color space handling - JPEG XL (different PR) - crop editor (different PR)
Code refactor to respect mostly a width of 80
Advantages are smaller file sizes when compression is acceptable (quality < 100) or lossless compression with quality = 100. Also the alpha channel is supported and kept in the images. Note 1: this only adds support for the export function, and is not general JPEG XL support for taggui. There is the fork https://github.com/yggdrasil75/taggui that does exactly this. Note 2: You might need `pip install pillow-jxl-plugin` beforehand to be able to export into JPEG XL.
Also refactor the code a bit to be able to use the target size calculation more easily in (future) other modules as well.
Also change the Settings infrastructure to send a Signal when a setting is changed.
Also rename CustomRectItem to MarkingItem
Also refactor a bit to use QSize instead of a simple tuple
This PR has significantly improved my workflow of preparing images for training. As an example this is how I used it for my test:
Conclusion: |
Fix context menu display on markings Respect "insert space after tag separator" for export
…that support transparency.
…ticaptioning can be used with the civitai trainer as well
… option to sort them to the end
@jhc13 this PR is now open for a month. Could you already have a look at it? I'm currently using it in a rather big captioning project and it's helping me a lot. So I'd be happy when it gets pulled soon as I think others will benefit from it as well. |
Hi @StableLlama, I apologize for not responding to you sooner. I have been busy with other things and did not have time to work on anything related to TagGUI. I appreciate all the time and effort you put into this and your other PRs, but I have decided not to merge this for now, for the following reasons:
You may disagree with my first point, and I do understand your perspective, but it just does not align with my personal vision for the project. You are welcome to add your features to your own fork of the program. If others find them useful too, then that's great. Thanks again for your contributions! |
As I've written, I see these additions not as a dataset management tool (for that far too much is missing) but as a workflow tool to prepare the images for training. One aspect is tagging/captioning (that's where taggui is very good at) but then also in creating masks for masked training and cropping the images. Especially for cropping I know no other tool that can do it as efficiently as this PR can do it. But as you have suggested I consider to create a fork that contains all the PR here that I think are very beneficial for efficiently preparing the images. |
@StableLlama this is fantastic work. Please consider making a fork with a broader vision if you have the time and passion to maintain it. It will outgrow the original project if you continue to bring new features, making it a Swiss Army knife for dataset preparation. |
@Spikhalskiy as I couldn't wait any longer, I've now created a fork, I'll call it "taggui workflow" as it is supporting the image preparation workflow. Next I'll pull a few other PRs here that are necessary for me. As written above: I'm more than happy when I don't need a fork and it could be united here. |
This PR adds functionality to crop an image and set areas to include and exclude when the image gets exported. All new features are:
inclusion and exclusion of image parts for masked training. Filter based on
markings and also their (partial) visibility
bucket sizes of the training scripts
I know it is big, so I tried to split off the first two steps, so it's building on #332 and #335 (for #332 I guess #337 would be beneficial as well, although I haven't tested it).
The changes and new features are best described in the updated README: https://github.com/StableLlama/taggui/tree/crop_editor?tab=readme-ov-file#cropping-and-masking-with-markings
Screenshot, simulating a clothing LoRA dataset preparation, with the new features active.
At this time this PR is now 100%
90%80%ready and I'd be happy about a first review and probably some foreign testing. To make it 100% ready, and to change it from draft to a real pull request, still missing is:Additional internal changes in this PR: