You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this bug It only happens in very rare cases. For this to happen, rotation must be turned on and the minimum image size must be small so that the add_border works.
i change detection/common.py line20
if auto_rotate or rotate:
minimum_image_size = 0
else:
minimum_image_size = 400
but this is not good solution
Command Line Arguments
config change
det_auto_rotate = true
Console logs
[local] Running inlocal mode
[local] Loading models
[local] Running text detection
[DefaultDetector] Adding border
[DefaultDetector] Detection resolution: 1536x1536
[DefaultDetector] Rerunning detection with 90° rotation
[DefaultDetector] Adding rotation
[DefaultDetector] Adding border
[DefaultDetector] Detection resolution: 1536x1536
[local] Running ocr
ERROR: [local] error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\imgwarp.cpp:3376: error: (-215:Assertion failed) _src.total() > 0 infunction'cv::warpPerspective'
Traceback (most recent call last):
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\__main__.py", line 94, in<module>
asyncio.run(dispatch(args))
File "C:\Users\eren-\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\eren-\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
returnfuture.result()
^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\__main__.py", line 56, in dispatch
await translator.translate_path(path, dest, args_dict)
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\mode\local.py", line 115, in translate_path
raise e
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\mode\local.py", line 111, in translate_path
if await self.translate_file(file_path, output_dest, params, config):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\mode\local.py", line 140, in translate_file
return await self._translate_file(path, dest, config, ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\mode\local.py", line 183, in _translate_file
ctx = await self.translate(img, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\manga_translator.py", line 174, in translate
result = await self._translate(config, ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\manga_translator.py", line 219, in _translate
ctx.textlines = await self._run_ocr(config, ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\manga_translator.py", line 330, in _run_ocr
textlines = await dispatch_ocr(config.ocr.ocr, ctx.img_rgb, ctx.textlines, config.ocr, self.device, self.verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\ocr\__init__.py", line 39, in dispatch
return await ocr.recognize(image, regions, config, verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\ocr\common.py", line 46, in recognize
return await self._recognize(image, textlines, config, verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\ocr\common.py", line 57, in _recognize
return await self.infer(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\utils\inference.py", line 350, in infer
return await self._infer(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\ocr\model_48px.py", line 72, in _infer
region_imgs = [q.get_transformed_region(image, d, text_height) forq, din quadrilaterals]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\eren-\projects\mangaTranslator\new-manga-translator\manga_translator\utils\generic.py", line 508, in get_transformed_region
region = cv2.warpPerspective(img_croped, M, (w, h))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\imgwarp.cpp:3376: error: (-215:Assertion failed) _src.total() > 0 infunction'cv::warpPerspective'
The text was updated successfully, but these errors were encountered:
Issue
this bug It only happens in very rare cases. For this to happen, rotation must be turned on and the minimum image size must be small so that the add_border works.
i change detection/common.py line20
if auto_rotate or rotate:
minimum_image_size = 0
else:
minimum_image_size = 400
but this is not good solution
Command Line Arguments
config change det_auto_rotate = true
Console logs
The text was updated successfully, but these errors were encountered: