Coder Social home page Coder Social logo

bgailleton / tvd_condat2013 Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 7.0 2.1 MB

Python implementation of the 1D Total Variation Denoising algorithm A Direct Algorithm for 1D Total Variation Denoising (Sign. Proc. Letters, DOI:10.1109/LSP.2013.2278339) using xtensor and pybind11 to bind c++ and numpy.

License: BSD 3-Clause "New" or "Revised" License

CMake 15.91% Python 19.59% C++ 64.50%

tvd_condat2013's People

Contributors

bgailleton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tvd_condat2013's Issues

MacOS & Python 3.8.9 gets error when running pip install

Hi there,

I get error when trying to install the package. I'm on MacOS Big Sur running Python 3.8.9 in a virtualenv.

I cloned your repo, activated my virtualenv and ran pip install ./TVD_Condat2013

Processing /Users/martin/Desktop/TVD_Condat2013
Requirement already satisfied: pybind11>=2.0.1 in /Users/martin/.virtualenvs/myenv/lib/python3.8/site-packages (from TVDCondat2013==0.0.1) (2.9.0)
Requirement already satisfied: numpy in /Users/martin/.virtualenvs/myenv/lib/python3.8/site-packages (from TVDCondat2013==0.0.1) (1.19.5)
Building wheels for collected packages: TVDCondat2013
  Building wheel for TVDCondat2013 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/martin/.virtualenvs/myenv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-req-build-65bjutj_/setup.py'"'"'; __file__='"'"'/private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-req-build-65bjutj_/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 /private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-wheel-wr43e01q
       cwd: /private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-req-build-65bjutj_/
  Complete output (20 lines):
  running bdist_wheel
  running build
  running build_ext
  creating var
  creating var/folders
  creating var/folders/49
  creating var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn
  creating var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/martin/.virtualenvs/myenv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c /var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/tmpo7e5_93b.cpp -o var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/tmpo7e5_93b.o -std=c++14
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/martin/.virtualenvs/myenv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c /var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/tmpifqhogfs.cpp -o var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/tmpifqhogfs.o -fvisibility=hidden
  building 'TVDCondat2013' extension
  creating build
  creating build/temp.macosx-10.14-x86_64-3.8
  creating build/temp.macosx-10.14-x86_64-3.8/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/martin/.virtualenvs/myenv/lib/python3.8/site-packages/pybind11/include -I/Users/martin/.virtualenvs/myenv/lib/python3.8/site-packages/pybind11/include -I/Users/martin/.virtualenvs/myenv/lib/python3.8/site-packages/numpy/core/include -I/Users/martin/.virtualenvs/myenv/include -I/Users/martin/.virtualenvs/myenv/Library/include -I/Users/martin/.virtualenvs/myenv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c src/main.cpp -o build/temp.macosx-10.14-x86_64-3.8/src/main.o -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO="0.0.1" -std=c++14 -fvisibility=hidden
  src/main.cpp:3:10: fatal error: 'xtensor/xmath.hpp' file not found
  #include "xtensor/xmath.hpp"
           ^~~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for TVDCondat2013
  Running setup.py clean for TVDCondat2013
Failed to build TVDCondat2013
Installing collected packages: TVDCondat2013
    Running setup.py install for TVDCondat2013 ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/martin/.virtualenvs/myenv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-req-build-65bjutj_/setup.py'"'"'; __file__='"'"'/private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-req-build-65bjutj_/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/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-record-4d_79p_e/install-record.txt --single-version-externally-managed --compile --install-headers /Users/martin/.virtualenvs/myenv/include/site/python3.8/TVDCondat2013
         cwd: /private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-req-build-65bjutj_/
    Complete output (15 lines):
    running install
    running build
    running build_ext
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/martin/.virtualenvs/myenv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c /var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/tmp9fwt3sy7.cpp -o var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/tmp9fwt3sy7.o -std=c++14
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/martin/.virtualenvs/myenv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c /var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/tmpeyanws0z.cpp -o var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/tmpeyanws0z.o -fvisibility=hidden
    building 'TVDCondat2013' extension
    creating build
    creating build/temp.macosx-10.14-x86_64-3.8
    creating build/temp.macosx-10.14-x86_64-3.8/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/martin/.virtualenvs/myenv/lib/python3.8/site-packages/pybind11/include -I/Users/martin/.virtualenvs/myenv/lib/python3.8/site-packages/pybind11/include -I/Users/martin/.virtualenvs/myenv/lib/python3.8/site-packages/numpy/core/include -I/Users/martin/.virtualenvs/myenv/include -I/Users/martin/.virtualenvs/myenv/Library/include -I/Users/martin/.virtualenvs/myenv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c src/main.cpp -o build/temp.macosx-10.14-x86_64-3.8/src/main.o -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO="0.0.1" -std=c++14 -fvisibility=hidden
    src/main.cpp:3:10: fatal error: 'xtensor/xmath.hpp' file not found
    #include "xtensor/xmath.hpp"
             ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/martin/.virtualenvs/myenv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-req-build-65bjutj_/setup.py'"'"'; __file__='"'"'/private/var/folders/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-req-build-65bjutj_/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/49/k84c0vjd0394sk846jmjrt9h0000gn/T/pip-record-4d_79p_e/install-record.txt --single-version-externally-managed --compile --install-headers /Users/martin/.virtualenvs/myenv/include/site/python3.8/TVDCondat2013 Check the logs for full command output.

Any idea how to resolve?

Regards,
Martin

Error wehn running pip install on Ubuntu 22

Hi Boris,

I've succesfully used your implementation in the past, but I am unable to install it on Ubuntu 22. I have installed xtensor and xtensor-python with conda, but to no avail. I keep getting the same error. Any idea? I paste the output below:

Thanks,
Jose

ERROR: Command errored out with exit status 1:
command: /home/jri/anaconda3/envs/sqwavefit/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-lj27max8/setup.py'"'"'; file='"'"'/tmp/pip-req-build-lj27max8/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 /tmp/pip-wheel-nrz9fwef
cwd: /tmp/pip-req-build-lj27max8/
Complete output (33 lines):
running bdist_wheel
running build
running build_ext
gcc -pthread -B /home/jri/anaconda3/envs/sqwavefit/compiler_compat -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/jri/anaconda3/envs/sqwavefit/include/python3.5m -c /tmp/tmpk8dvo_4j.cpp -o tmp/tmpk8dvo_4j.o -std=c++14
cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/jri/anaconda3/envs/sqwavefit/compiler_compat -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/jri/anaconda3/envs/sqwavefit/include/python3.5m -c /tmp/tmpbx2g14hy.cpp -o tmp/tmpbx2g14hy.o -fvisibility=hidden
cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
building 'TVDCondat2013' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
gcc -pthread -B /home/jri/anaconda3/envs/sqwavefit/compiler_compat -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Iinclude -Iinclude -I/home/jri/anaconda3/envs/sqwavefit/lib/python3.5/site-packages/numpy/core/include -I/home/jri/anaconda3/envs/sqwavefit/include -I/home/jri/anaconda3/envs/sqwavefit/Library/include -I/home/jri/anaconda3/envs/sqwavefit/include/python3.5m -c src/main.cpp -o build/temp.linux-x86_64-3.5/src/main.o -DVERSION_INFO="0.0.1" -std=c++14 -fvisibility=hidden
cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
src/main.cpp: In function ‘xt::pyarray TVD(xt::pyarray, double)’:
src/main.cpp:169:23: error: ‘adapt’ is not a member of ‘xt’; did you mean ‘xadapt’?
169 | auto output_2 = xt::adapt(output);
| ^~~~~
| xadapt
src/main.cpp: In function ‘xt::pyarray D_TVD_R(xt::pyarray, double)’:
src/main.cpp:328:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
328 | for(size_t i=1;i<size;i++)
| ~^~~~~
src/main.cpp:338:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
338 | for(size_t i=0;i<size;i++)
| ~^~~~~
src/main.cpp:350:21: error: ‘adapt’ is not a member of ‘xt’; did you mean ‘xadapt’?
350 | auto output = xt::adapt(retrend);
| ^~~~~
| xadapt
src/main.cpp: At global scope:
src/main.cpp:356:16: error: expected constructor, destructor, or type conversion before ‘(’ token
356 | PYBIND11_MODULE(TVDCondat2013, m)
| ^
error: command 'gcc' failed with exit status 1

ModuleNotFoundError: No module named 'TVDCondat2013'

hello I try to install 'TVDCondat 2013' with the following command (pip install TVDCondat2013) but when I run my program is give following result:

  • user@user-NV57H:~$ python --version
  • Python 3.6.8 :: Anaconda 4.3.1 (64-bit)
  • user@user-NV57H:~$ pip install TVDCondat2013
  • Requirement already satisfied: TVDCondat2013 in ./anaconda3/lib/python3.6/site-packages/TVDCondat2013-0.0.1-py3.6-linux-x86_64.egg (0.0.1)
  • Requirement already satisfied: pybind11>=2.0.1 in ./anaconda3/lib/python3.6/site-packages (from TVDCondat2013) (2.2.4)
  • Requirement already satisfied: numpy in ./anaconda3/lib/python3.6/site-packages (from TVDCondat2013) (1.16.4)**

Error:
ModuleNotFoundError: No module named 'TVDCondat2013'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.