ericmjonas / pybm3d Goto Github PK
View Code? Open in Web Editor NEWPython wrapper around bm3d
License: GNU General Public License v3.0
Python wrapper around bm3d
License: GNU General Public License v3.0
Unable to install package pybm3d... I am getting the error during installation..
pip install pybm3d
Collecting pybm3d
Using cached pybm3d-0.2.1.tar.gz (1.1 MB)
Requirement already satisfied: setuptools>=18.0 in c:\users\amit\anaconda3\lib\site-packages (from pybm3d) (54.2.0)
Requirement already satisfied: cython>=0.27 in c:\users\amit\anaconda3\lib\site-packages (from pybm3d) (0.29.21)
Requirement already satisfied: numpy>=1.13 in c:\users\amit\anaconda3\lib\site-packages (from pybm3d) (1.19.5)
Building wheels for collected packages: pybm3d
Building wheel for pybm3d (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\amit\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py'"'"'; file='"'"'C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\AMIT\AppData\Local\Temp\pip-wheel-ampnbymf'
cwd: C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5
Complete output (45 lines):
c:\users\amit\anaconda3\lib\site-packages\setuptools\dist.py:642: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\pybm3d
copying pybm3d_init_.py -> build\lib.win-amd64-3.8\pybm3d
running build_ext
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py", line 128, in
setup(
File "c:\users\amit\anaconda3\lib\site-packages\setuptools_init_.py", line 153, in setup
return distutils.core.setup(**attrs)
File "c:\users\amit\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\amit\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\amit\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\amit\anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
self.run_command('build')
File "c:\users\amit\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\amit\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\amit\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\amit\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\amit\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\amit\anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
_build_ext.run(self)
File "c:\users\amit\anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "c:\users\amit\anaconda3\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py", line 23, in build_extensions
self.customize_compiler_for_c_args_and_nvcc()
File "C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py", line 49, in customize_compiler_for_c_args_and_nvcc
default_compiler_so = self.compiler.compiler_so
AttributeError: 'MSVCCompiler' object has no attribute 'compiler_so'
ERROR: Failed building wheel for pybm3d
Running setup.py clean for pybm3d
Failed to build pybm3d
Installing collected packages: pybm3d
Running setup.py install for pybm3d ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\amit\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py'"'"'; file='"'"'C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\AMIT\AppData\Local\Temp\pip-record-epe3n2v0\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\amit\anaconda3\Include\pybm3d'
cwd: C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5
Complete output (47 lines):
c:\users\amit\anaconda3\lib\site-packages\setuptools\dist.py:642: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\pybm3d
copying pybm3d_init_.py -> build\lib.win-amd64-3.8\pybm3d
running build_ext
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py", line 128, in
setup(
File "c:\users\amit\anaconda3\lib\site-packages\setuptools_init_.py", line 153, in setup
return distutils.core.setup(**attrs)
File "c:\users\amit\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\amit\anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\amit\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\amit\anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\amit\anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\amit\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\amit\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\amit\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\amit\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\amit\anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\amit\anaconda3\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
_build_ext.run(self)
File "c:\users\amit\anaconda3\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "c:\users\amit\anaconda3\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py", line 23, in build_extensions
self.customize_compiler_for_c_args_and_nvcc()
File "C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py", line 49, in customize_compiler_for_c_args_and_nvcc
default_compiler_so = self.compiler.compiler_so
AttributeError: 'MSVCCompiler' object has no attribute 'compiler_so'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\amit\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py'"'"'; file='"'"'C:\Users\AMIT\AppData\Local\Temp\pip-install-b8is0xpi\pybm3d_a8555608938a494f92fee08bece358a5\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\AMIT\AppData\Local\Temp\pip-record-epe3n2v0\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\amit\anaconda3\Include\pybm3d' Check the logs for full command output.
Based on this.
when I install bm3m,then
import pybm3d
,error occur,,
/pybm3d/bm3d.so: undefined symbol: lzma_stream_decoder
,actually , I install lzma library already,so what happened to me?
When applying pybm3d to an image that has a smooth black perimeter with strict 0 values, it returns the image with np.nan values at those pixels.
Working on a remote server running Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-79-generic x86_64) I am able to install pybm3d using pip, but once I run it on the example provided the result is all zeros (black image of same dimension).
I can provide more details about the system is required.
installed of PyBM3D but still this problem
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pybm3d/bm3d.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pybm3d/bm3d.cpython-36m-darwin.so
Reason: image not found
Hello, I would really appreciate to have color support for pybm3d. Is there any way I can help you with that?
Hello,
Running on a Mac, clean install today (required upgrading libpng, libjpeg, libtiff by hand for some reason).
When I run the demo from the README, I get poor performance:
import numpy as np
import skimage.data
from skimage.measure import compare_psnr
import pybm3d
noise_std_dev = 40
img = skimage.data.astronaut()
noise = np.random.normal(scale=noise_std_dev,
size=img.shape).astype(img.dtype)
noisy_img = img + noise
out = pybm3d.bm3d.bm3d(noisy_img, noise_std_dev)
noise_psnr = compare_psnr(img, noisy_img)
out_psnr = compare_psnr(img, out)
print("PSNR of noisy image: ", noise_psnr)
print("PSNR of reconstructed image: ", out_psnr)
PSNR of noisy image: 8.790840053416506
PSNR of reconstructed image: 9.694752220332331
If I convert to greyscale first with skimage.color.rgb2grey
, and set sigma = 0.2, the perf is even worse:
PSNR of noisy image: 13.975934859277583
PSNR of reconstructed image: 27.27140695331532
I'm not sure how to debug this, any advice appreciated!
an issue here!
check FFTW:
Warning: fftw 3.3.9 is already installed and up-to-date.
running after downloading:
Running setup.py install for pybm3d ... error ERROR: Command errored out with exit status 1: command: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wd/3nz9vclj4q7gqk8wcrnfynpr0000gn/T/pip-install-n1v8ikx5/pybm3d/setup.py'"'"'; __file__='"'"'/private/var/folders/wd/3nz9vclj4q7gqk8wcrnfynpr0000gn/T/pip-install-n1v8ikx5/pybm3d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/wd/3nz9vclj4q7gqk8wcrnfynpr0000gn/T/pip-record-jz4841dj/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.7m/pybm3d cwd: /private/var/folders/wd/3nz9vclj4q7gqk8wcrnfynpr0000gn/T/pip-install-n1v8ikx5/pybm3d/ Complete output (129 lines): running install running build running build_py creating build creating build/lib.macosx-10.9-x86_64-3.7 creating build/lib.macosx-10.9-x86_64-3.7/pybm3d copying pybm3d/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/pybm3d running build_ext skipping 'pybm3d/bm3d.cpp' Cython extension (up-to-date) building 'pybm3d.bm3d' extension creating build/temp.macosx-10.9-x86_64-3.7 creating build/temp.macosx-10.9-x86_64-3.7/pybm3d creating build/temp.macosx-10.9-x86_64-3.7/bm3d_src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include/python3.7m -I/opt/anaconda3/lib/python3.7/site-packages/numpy/core/include -c pybm3d/bm3d.cpp -o build/temp.macosx-10.9-x86_64-3.7/pybm3d/bm3d.o -march=native -Wall -Wextra In file included from pybm3d/bm3d.cpp:536: In file included from /opt/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4: In file included from /opt/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12: In file included from /opt/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1832: /opt/anaconda3/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings] #warning "Using deprecated NumPy API, disable it with " \ ^ pybm3d/bm3d.cpp:22355:21: error: no member named 'exc_type' in '_ts' *type = tstate->exc_type; ~~~~~~ ^ pybm3d/bm3d.cpp:22356:22: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'? *value = tstate->exc_value; ^~~~~~~~~ curexc_value /opt/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here PyObject *curexc_value; ^ pybm3d/bm3d.cpp:22357:19: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'? *tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback /opt/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here PyObject *curexc_traceback; ^ pybm3d/bm3d.cpp:22364:24: error: no member named 'exc_type' in '_ts' tmp_type = tstate->exc_type; ~~~~~~ ^ pybm3d/bm3d.cpp:22365:25: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value /opt/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here PyObject *curexc_value; ^ pybm3d/bm3d.cpp:22366:22: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback /opt/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here PyObject *curexc_traceback; ^ pybm3d/bm3d.cpp:22367:13: error: no member named 'exc_type' in '_ts' tstate->exc_type = type; ~~~~~~ ^ pybm3d/bm3d.cpp:22368:13: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'? tstate->exc_value = value; ^~~~~~~~~ curexc_value /opt/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here PyObject *curexc_value; ^ pybm3d/bm3d.cpp:22369:13: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'? tstate->exc_traceback = tb; ^~~~~~~~~~~~~ curexc_traceback /opt/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here PyObject *curexc_traceback; ^ pybm3d/bm3d.cpp:22439:24: error: no member named 'exc_type' in '_ts' tmp_type = tstate->exc_type; ~~~~~~ ^ pybm3d/bm3d.cpp:22440:25: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value /opt/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here PyObject *curexc_value; ^ pybm3d/bm3d.cpp:22441:22: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback /opt/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here PyObject *curexc_traceback; ^ pybm3d/bm3d.cpp:22442:13: error: no member named 'exc_type' in '_ts' tstate->exc_type = local_type; ~~~~~~ ^ pybm3d/bm3d.cpp:22443:13: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'? tstate->exc_value = local_value; ^~~~~~~~~ curexc_value /opt/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here PyObject *curexc_value; ^ pybm3d/bm3d.cpp:22444:13: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'? tstate->exc_traceback = local_tb; ^~~~~~~~~~~~~ curexc_traceback /opt/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here PyObject *curexc_traceback; ^ pybm3d/bm3d.cpp:22681:24: error: no member named 'exc_type' in '_ts' tmp_type = tstate->exc_type; ~~~~~~ ^ pybm3d/bm3d.cpp:22682:25: error: no member named 'exc_value' in '_ts'; did you mean 'curexc_value'? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value /opt/anaconda3/include/python3.7m/pystate.h:240:15: note: 'curexc_value' declared here PyObject *curexc_value; ^ pybm3d/bm3d.cpp:22683:22: error: no member named 'exc_traceback' in '_ts'; did you mean 'curexc_traceback'? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback /opt/anaconda3/include/python3.7m/pystate.h:241:15: note: 'curexc_traceback' declared here PyObject *curexc_traceback; ^ pybm3d/bm3d.cpp:22684:13: error: no member named 'exc_type' in '_ts' tstate->exc_type = *type; ~~~~~~ ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 1 warning and 20 errors generated. error: command 'gcc' failed with exit status 1
ERROR: Command errored out with exit status 1: /opt/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wd/3nz9vclj4q7gqk8wcrnfynpr0000gn/T/pip-install-n1v8ikx5/pybm3d/setup.py'"'"'; __file__='"'"'/private/var/folders/wd/3nz9vclj4q7gqk8wcrnfynpr0000gn/T/pip-install-n1v8ikx5/pybm3d/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/wd/3nz9vclj4q7gqk8wcrnfynpr0000gn/T/pip-record-jz4841dj/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.7m/pybm3d Check the logs for full command output.
ths for your kind work, since using python interface with something wrong, I build it from bm3d_src, here is my hardware:
88 Intel(R) Xeon(R) CPU E5-2696 v4 @ 2.20GHz
I test a picture, its width = 480,height=640, with below parameter:
./bm3d IMG_20190730_102349.jpg 10 ImDenoised2349.png ImBasic.png -tau_2 d_hard biorls
,it almost waster 15s for one picture, is there something wrong?
Hi.
I tried to install pybm3d using pip but I am getting the following error.
bm3d_src/iio.c: At top level:
bm3d_src/iio.c:1209:23: fatal error: jpeglib.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pybm3d
Any suggestion how can I fix that?
When using the bm3d function, it asks for standard deviation of noise
out = pybm3d.bm3d.bm3d(noisy_img,
noise_std_dev)`
Bm3d can also work without knowing the standard deviation of the noise
How to use the function without having to give nois_std_dev
When I try to import pybm3d, it raises this error:
ImportError: dlopen(/.../anaconda3/lib/python3.6/site-packages/pybm3d/bm3d.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/libtiff/lib/libtiff.5.dylib
Referenced from: /.../anaconda3/lib/python3.6/site-packages/pybm3d/bm3d.cpython-36m-darwin.so
Reason: image not found
Can someone help me out?
I tried installing pybm3d using pip on my machine (macOS Big Sur 11.1), yet it fails with the message "Command errored out with exit status 1". I've tried the macOS equivalent for the fix suggested in #12, to no avail.
Any suggestions on how to fix this issue?
(Full output here: https://pastebin.com/KVaWfzQv)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.