Skip to content

Conversation

@heinrichI
Copy link

image
@bropines
Copy link
Collaborator

awesome

@heinrichI
Copy link
Author

I don't like how the processing is done through page and page_index in on_pagtrans_finished, but I don't want to make more large-scale changes.

    def on_pagtrans_finished(self, page: str):
        keys_list = list(self.imgtrans_proj.pages.keys())
        page_index = keys_list.index(page)
@bropines
Copy link
Collaborator

bropines commented Aug 16, 2025

image

Here I also threw this with neurons and my own ideas. I can show the code (I have a different implementation)

@bropines
Copy link
Collaborator

@dmMaze Should we push this to the repo?

@heinrichI
Copy link
Author

I have a different implementation

So maybe yours is better? Show.

@bropines
Copy link
Collaborator

bropines commented Aug 17, 2025

I have a different implementation

So maybe yours is better? Show.

bropines@035d72e

and this

bropines@849f1fe

@bropines
Copy link
Collaborator

@heinrichI
Copy link
Author

I would encapsulate the selected items in the signal data
run_on_selected = Signal(),
so there is no need to call
selected_items = self.pageList.selectedItems()

@heinrichI
Copy link
Author

@bropines on translation:
Traceback (most recent call last):
File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 517, in run
self.job()
File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 315, in
self.job = lambda: self._imgtrans_pipeline_selection(page_keys)
File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 480, in _imgtrans_pipeline_selection
self._process_single_page(imgname)
File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 424, in _process_single_page
elif not self.low_vram_trans:
AttributeError: 'ImgtransThread' object has no attribute 'low_vram_trans'

On OCR:
Exception has occurred: NameError
name 'unload_modules' is not defined
File "J:\Comic translate\BallonsTranslator\ui\mainwindow.py", line 1103, in on_imgtrans_pipeline_finished
self.module_manager.unload_all_models()
File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 776, in finishImgtransPipeline
self.imgtrans_pipeline_finished.emit()
File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 734, in on_update_ocr_progress
self.finishImgtransPipeline()
File "J:\Comic translate\BallonsTranslator\launch.py", line 290, in main
sys.exit(app.exec())
File "J:\Comic translate\BallonsTranslator\launch.py", line 348, in
main()
NameError: name 'unload_modules' is not defined

I tested your repository.

@bropines
Copy link
Collaborator

@bropines on translation: Traceback (most recent call last): File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 517, in run self.job() File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 315, in self.job = lambda: self._imgtrans_pipeline_selection(page_keys) File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 480, in _imgtrans_pipeline_selection self._process_single_page(imgname) File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 424, in _process_single_page elif not self.low_vram_trans: AttributeError: 'ImgtransThread' object has no attribute 'low_vram_trans'

On OCR: Exception has occurred: NameError name 'unload_modules' is not defined File "J:\Comic translate\BallonsTranslator\ui\mainwindow.py", line 1103, in on_imgtrans_pipeline_finished self.module_manager.unload_all_models() File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 776, in finishImgtransPipeline self.imgtrans_pipeline_finished.emit() File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 734, in on_update_ocr_progress self.finishImgtransPipeline() File "J:\Comic translate\BallonsTranslator\launch.py", line 290, in main sys.exit(app.exec()) File "J:\Comic translate\BallonsTranslator\launch.py", line 348, in main() NameError: name 'unload_modules' is not defined

I tested your repository.

I fix it

@bropines
Copy link
Collaborator

@bropines on translation: Traceback (most recent call last): File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 517, in run self.job() File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 315, in self.job = lambda: self._imgtrans_pipeline_selection(page_keys) File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 480, in _imgtrans_pipeline_selection self._process_single_page(imgname) File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 424, in _process_single_page elif not self.low_vram_trans: AttributeError: 'ImgtransThread' object has no attribute 'low_vram_trans'

On OCR: Exception has occurred: NameError name 'unload_modules' is not defined File "J:\Comic translate\BallonsTranslator\ui\mainwindow.py", line 1103, in on_imgtrans_pipeline_finished self.module_manager.unload_all_models() File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 776, in finishImgtransPipeline self.imgtrans_pipeline_finished.emit() File "J:\Comic translate\BallonsTranslator\ui\module_manager.py", line 734, in on_update_ocr_progress self.finishImgtransPipeline() File "J:\Comic translate\BallonsTranslator\launch.py", line 290, in main sys.exit(app.exec()) File "J:\Comic translate\BallonsTranslator\launch.py", line 348, in main() NameError: name 'unload_modules' is not defined

I tested your repository.

try

@heinrichI
Copy link
Author

@bropines So, I managed to work with your version, it works. Passing page names looks nicer than my dictionary pass. The only thing is, as I said, it is better when there are fewer calls to global variables and replace the call to pageList.selectedItems() with the transfer of selected pages to the signal "run_on_selected".

@heinrichI
Copy link
Author

heinrichI commented Aug 19, 2025

@bropines There is something wrong with your branch. When switching pages, the formatting, size and position of blocks are lost.

@bropines
Copy link
Collaborator

bropines commented Aug 19, 2025

@bropines There is something wrong with your branch. When switching pages, the formatting, size and position of blocks are lost.

Can I have a video? I didn't touch it... You seem to have my telegram. Write to me there. Because PR is not very convenient for such discussions

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

Labels

None yet

2 participants