VoxelCubes / PanelCleaner

An AI-powered tool to clean manga panels.
GNU General Public License v3.0
208 stars 16 forks source link

AttributeError: module 'scipy' has no attribute 'signal' #1

Closed SamLS98 closed 1 year ago

SamLS98 commented 1 year ago

I have python 3.10.6 and scipy 1.8.0 installed.

`pcleaner clean 01.png

Running text detection AI model... Using device for text detection model: cuda 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.15s/it]

Running box data Pre-Processor... 2023-02-25 14:20:22.003 | INFO | manga_ocr.ocr:init:13 - Loading OCR model from kha-white/manga-ocr-base 2023-02-25 14:20:25.343 | INFO | manga_ocr.ocr:init:19 - Using CUDA 2023-02-25 14:20:25.475 | INFO | manga_ocr.ocr:init:29 - OCR ready 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 888.62it/s]

OCR Analytics

Number of boxes: 11 | Number of small boxes: 0 (0%) Number of removed boxes: 0 (0% total, N/A of small boxes) No not-removed small boxes found.

Removed bubbles:

Running Cleaner... 0%| | 0/1 [00:00<?, ?it/s] multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home/argyll/.local/lib/python3.10/site-packages/pcleaner/cleaner.py", line 53, in clean_page mask_fitments: list[st.MaskFittingResults] = [ File "/home/argyll/.local/lib/python3.10/site-packages/pcleaner/cleaner.py", line 54, in ops.pick_best_mask( File "/home/argyll/.local/lib/python3.10/site-packages/pcleaner/image_ops.py", line 321, in pick_best_mask masks = make_mask_steps_convolution( File "/home/argyll/.local/lib/python3.10/site-packages/pcleaner/image_ops.py", line 171, in make_mask_steps_convolution padded_mask = scipy.signal.convolve2d(padded_mask, kernel, mode="same") AttributeError: module 'scipy' has no attribute 'signal' """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/argyll/.local/bin/pcleaner", line 8, in sys.exit(main()) File "/home/argyll/.local/lib/python3.10/site-packages/pcleaner/main.py", line 193, in main run_cleaner( File "/home/argyll/.local/lib/python3.10/site-packages/pcleaner/main.py", line 333, in run_cleaner for analytic in tqdm(pool.imap(cl.clean_page, data), total=len(data)): File "/home/argyll/.local/lib/python3.10/site-packages/tqdm/std.py", line 1195, in iter for obj in iterable: File "/usr/lib/python3.10/multiprocessing/pool.py", line 873, in next raise value AttributeError: module 'scipy' has no attribute 'signal' `

SamLS98 commented 1 year ago

nvm, I created a virtualenv with only pcleaner installed and it worked. Something must be wrong with my Python installation.

VoxelCubes commented 1 year ago

Sorry I didn't see it sooner, but yes, it looks like the scipy.signal module is missing, I use that for doing the Fast Fourier Transform. It should pull it in by default, so I'm not sure what went wrong.

rautyrauty commented 1 year ago

I had the same problem. Just added to image_ops.py "from scipy import signal"