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

panel with blocks navigation and save/load current state #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TaunT
Copy link

@TaunT TaunT commented Aug 7, 2024

New panel in manual mode:

  1. Navigation between text blocks
  2. Import and export current state - recognized text, translations and blocks coordinates

image

@TaunT TaunT force-pushed the import_and_export branch 5 times, most recently from a74a614 to 76d3b39 Compare August 11, 2024 16:24
@TaunT
Copy link
Author

TaunT commented Aug 11, 2024

@ogkalu2 Thank you for your trust and the great honor of participating in the project =)
What about this functionality, do you not like the meaning of the additions, or are there problems with the code?

  1. I use import and export very often myself. And I added the coordinates of the blocks there, now they are also saved and loaded - now it is very easy to re-edit the page.
  2. During the translation process, I sometimes switch to other tasks or get distracted by looking at photos of cute cats or boobs, so before I made the menu highlighting, I sometimes made a mistake about which step I was on and clicked the wrong button
  3. It is convenient to scroll through the blocks to check all the translations for errors again

p.s. rebased to fresh main branch

@TaunT
Copy link
Author

TaunT commented Aug 11, 2024

@ogkalu2 When merging a branch with text size and color, 3 lines were lost, or did you remove them? Block font settings buttons are inactive in automatic mode

comic.py

    def batch_mode_selected(self):
        ...
        self.set_font_settings_enabled(False)

    def manual_mode_selected(self):
        ...
        self.set_font_settings_enabled(True)

main_window.py

    def set_font_settings_enabled(self, enabled: bool):
        self.min_font_spinbox.setEnabled(enabled)
        self.max_font_spinbox.setEnabled(enabled)
        self.block_font_color_button.setEnabled(enabled)

@ogkalu2
Copy link
Owner

ogkalu2 commented Aug 11, 2024

@ogkalu2 When merging a branch with text size and color, 3 lines were lost, or did you remove them? Block font settings buttons are inactive in automatic mode

comic.py

    def batch_mode_selected(self):
        ...
        self.set_font_settings_enabled(False)

    def manual_mode_selected(self):
        ...
        self.set_font_settings_enabled(True)

main_window.py

    def set_font_settings_enabled(self, enabled: bool):
        self.min_font_spinbox.setEnabled(enabled)
        self.max_font_spinbox.setEnabled(enabled)
        self.block_font_color_button.setEnabled(enabled)

Not sure what happened there but i've added it back. i didn't delete it.

@ogkalu2
Copy link
Owner

ogkalu2 commented Aug 11, 2024

@ogkalu2 Thank you for your trust and the great honor of participating in the project =) What about this functionality, do you not like the meaning of the additions, or are there problems with the code?

  1. I use import and export very often myself. And I added the coordinates of the blocks there, now they are also saved and loaded - now it is very easy to re-edit the page.
  2. During the translation process, I sometimes switch to other tasks or get distracted by looking at photos of cute cats or boobs, so before I made the menu highlighting, I sometimes made a mistake about which step I was on and clicked the wrong button
  3. It is convenient to scroll through the blocks to check all the translations for errors again

p.s. rebased to fresh main branch

@TaunT

  1. Saving the state of the app as a Project (saving the PROJECT #101) is a better idea i think. I don't want to clutter the main window before that with buttons just to save text.
  2. Manual mode isn't really strictly meant to be used in that exact order. Someone might skip or interchange between the buttons. Can you implement the highlighting such that it only highlights the last used button at a time ?
  3. I don't mind this at all.

@TaunT
Copy link
Author

TaunT commented Aug 12, 2024

@ogkalu2 "Saving the state of the app as a Project (#101)"
In fact, my export-import now saves the necessary information to load it later. But only for one picture in manual mode. It can be improved, and saved for all, and when importing, draw all the blocks again (now the coordinates of the current ones are simply changed) I have enough of this in my work for now, then I will try to finish it when I have time, if you don’t do it earlier.

@TaunT TaunT force-pushed the import_and_export branch from 76d3b39 to 2cfccd0 Compare August 12, 2024 04:48
@TaunT TaunT force-pushed the import_and_export branch 2 times, most recently from 18d1366 to 754c11f Compare August 20, 2024 08:56
@TaunT
Copy link
Author

TaunT commented Aug 20, 2024

@ogkalu2 Hi! I improved my import-export, it seems to me that it can be conveniently worked with manually until you make a general save of the project. Maybe take a look? Is it possible to merge this into the project?
image

@TaunT TaunT force-pushed the import_and_export branch 6 times, most recently from 765f3f2 to 5c6f0c7 Compare August 22, 2024 11:24
@TaunT TaunT changed the title blocks navigation + import/export + menu highlight panel with blocks navigation and save/load current state Aug 22, 2024
@TaunT
Copy link
Author

TaunT commented Aug 22, 2024

@ogkalu2 Thanks for the fix for drawing and deleting rectangles!
I rebased this branch and cleaned it up, here is ONLY the new manual mode panel with export and import of finished translation and clean image.
(Maybe it will be easier for you to decide to add this to the project)

Now it was possible to load the cleaned image, blocks and easily change them a little.

p.s. By the way, I thought, it is possible to add a call of my function save_blocks_state in auto-mode after processing each image. And this will save the whole project, which people ask for =)

@notimp
Copy link

notimp commented Aug 24, 2024

As I reported in the other pull request, I sometimes get rectangles that lose the text thats attached to them, when I do a final control pass on "automatic mode" runs. About twice every comic.

If "save state" could be implemented in a way where it would not be "overwritten" automatically. Or if a "save as (with a different filename)" for save state would be possible, that would help me with those cases - as as soon as a rectange loses its attached (auto translated) text, I could reload the state to get it back.

Its a work around, but if you could do that on a "per page basis" (can still be one project file), that would be a workable workaround for me loosing text thats attached to rectangles in the quality control pass after an automatic mode run. Currently, as soon as that happens, I have to stop working on the image, and continue with the next one, so I dont loose the auto recognized text on the image.

After that the image stays as auto mode saved it, because I have no way of getting the recognized states back into comic-translate currently.

Thank you.

edit: Actually, if you would allow or create a backup "state" file for the entire project, in the translation folder in the project folder and made that loadable as well, that would probably also save me one click per page. :) As I then just have to note down the pages, where text attached to a rectangle got lost, and then revisit them after finishing the project (by loading on such state file that covers the entire project, not just every page).

edit2: If after auto mode runs every page state is auto saved once, and that save is not overwritten (automatically during the quality controll pass I'm doing after auto mode), that would work for me as well, and probably cause the least amounts of click. Because as soon as the issue pops up, I could just reload state for that page. But for that to work an autosave for every page after auto mode ran would have to have occured. If you can implement that - that probably would be the best case scenario for me (aside from having the issue fixed, that rectangles loose attached text, about twice every comic).

Thank you!

@notimp
Copy link

notimp commented Aug 24, 2024

Also by default probably save those state files within the translation folder of the project. So you dont run into issues where the state files get loaded for different projects, because the file names were the same. (001.jpg, 002.jpg, and so on.)

Or give them a date and time timestamp as a filename (if you group them into one file, per project) by default.

Just as a reminder in case you thought about storing them centrally. ;)

@TaunT
Copy link
Author

TaunT commented Aug 24, 2024

@notimp of course a date and time stamp is added so as not to accidentally overwrite it)

RCO002.jpg
RCO002_2024-08-24_13-33-21_cleaned.jpg
RCO002_2024-08-24_13-39-34.txt

@TaunT TaunT force-pushed the import_and_export branch 2 times, most recently from 492e115 to 83188ff Compare August 28, 2024 08:13
@TaunT
Copy link
Author

TaunT commented Aug 28, 2024

@ogkalu2 rebased on current master

@TaunT TaunT force-pushed the import_and_export branch from 83188ff to c3184d4 Compare August 29, 2024 05:43
@TaunT TaunT force-pushed the import_and_export branch from c3184d4 to 5929dee Compare August 30, 2024 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants