Skip to content

Commit 26f8cf2

Browse files
committed
Initial commit
0 parents  commit 26f8cf2

16 files changed

+764
-0
lines changed

.gitignore

+228
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
CMakeLists.txt.user
2+
CMakeCache.txt
3+
CMakeFiles
4+
CMakeScripts
5+
Testing
6+
Makefile
7+
cmake_install.cmake
8+
install_manifest.txt
9+
compile_commands.json
10+
CTestTestfile.cmake
11+
_deps
12+
# Build dir
13+
**/build*
14+
build*
15+
debug_build
16+
release_build
17+
/bin
18+
/lib
19+
/install
20+
*.egg-info
21+
src
22+
.vscode
23+
24+
# Created by https://www.toptal.com/developers/gitignore/api/c++
25+
# Edit at https://www.toptal.com/developers/gitignore?templates=c++
26+
27+
### C++ ###
28+
# Prerequisites
29+
*.d
30+
31+
# Compiled Object files
32+
*.slo
33+
*.lo
34+
*.o
35+
*.obj
36+
37+
# Precompiled Headers
38+
*.gch
39+
*.pch
40+
41+
# Compiled Dynamic libraries
42+
*.so
43+
*.dylib
44+
*.dll
45+
46+
# Fortran module files
47+
*.mod
48+
*.smod
49+
50+
# Compiled Static libraries
51+
*.lai
52+
*.la
53+
*.a
54+
*.lib
55+
56+
# Executables
57+
*.exe
58+
*.out
59+
*.app
60+
61+
# End of https://www.toptal.com/developers/gitignore/api/c++
62+
63+
# Created by https://www.toptal.com/developers/gitignore/api/python
64+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
65+
66+
### Python ###
67+
# Byte-compiled / optimized / DLL files
68+
__pycache__/
69+
*.py[cod]
70+
*$py.class
71+
72+
# C extensions
73+
*.so
74+
75+
# Distribution / packaging
76+
.Python
77+
build/
78+
develop-eggs/
79+
dist/
80+
downloads/
81+
eggs/
82+
.eggs/
83+
lib/
84+
lib64/
85+
parts/
86+
sdist/
87+
var/
88+
wheels/
89+
share/python-wheels/
90+
*.egg-info/
91+
.installed.cfg
92+
*.egg
93+
MANIFEST
94+
95+
# PyInstaller
96+
# Usually these files are written by a python script from a template
97+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
98+
*.manifest
99+
*.spec
100+
101+
# Installer logs
102+
pip-log.txt
103+
pip-delete-this-directory.txt
104+
105+
# Unit test / coverage reports
106+
htmlcov/
107+
.tox/
108+
.nox/
109+
.coverage
110+
.coverage.*
111+
.cache
112+
nosetests.xml
113+
coverage.xml
114+
*.cover
115+
*.py,cover
116+
.hypothesis/
117+
.pytest_cache/
118+
cover/
119+
120+
# Translations
121+
*.mo
122+
*.pot
123+
124+
# Django stuff:
125+
*.log
126+
local_settings.py
127+
db.sqlite3
128+
db.sqlite3-journal
129+
130+
# Flask stuff:
131+
instance/
132+
.webassets-cache
133+
134+
# Scrapy stuff:
135+
.scrapy
136+
137+
# Sphinx documentation
138+
docs/_build/
139+
140+
# PyBuilder
141+
.pybuilder/
142+
target/
143+
144+
# Jupyter Notebook
145+
.ipynb_checkpoints
146+
147+
# IPython
148+
profile_default/
149+
ipython_config.py
150+
151+
# pyenv
152+
# For a library or package, you might want to ignore these files since the code is
153+
# intended to run in multiple environments; otherwise, check them in:
154+
# .python-version
155+
156+
# pipenv
157+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
158+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
159+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
160+
# install all needed dependencies.
161+
#Pipfile.lock
162+
163+
# poetry
164+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
165+
# This is especially recommended for binary packages to ensure reproducibility, and is more
166+
# commonly ignored for libraries.
167+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
168+
#poetry.lock
169+
170+
# pdm
171+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
172+
#pdm.lock
173+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
174+
# in version control.
175+
# https://pdm.fming.dev/#use-with-ide
176+
.pdm.toml
177+
178+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
179+
__pypackages__/
180+
181+
# Celery stuff
182+
celerybeat-schedule
183+
celerybeat.pid
184+
185+
# SageMath parsed files
186+
*.sage.py
187+
188+
# Environments
189+
.env
190+
.venv
191+
env/
192+
venv/
193+
ENV/
194+
env.bak/
195+
venv.bak/
196+
197+
# Spyder project settings
198+
.spyderproject
199+
.spyproject
200+
201+
# Rope project settings
202+
.ropeproject
203+
204+
# mkdocs documentation
205+
/site
206+
207+
# mypy
208+
.mypy_cache/
209+
.dmypy.json
210+
dmypy.json
211+
212+
# Pyre type checker
213+
.pyre/
214+
215+
# pytype static type analyzer
216+
.pytype/
217+
218+
# Cython debug symbols
219+
cython_debug/
220+
221+
# PyCharm
222+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
223+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
224+
# and can be added to the global gitignore or merged into this file. For a more nuclear
225+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
226+
#.idea/
227+
228+
# End of https://www.toptal.com/developers/gitignore/api/python

CMakeLists.txt

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
project(vlfeat.py)
4+
5+
6+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
7+
8+
include(FetchContent)
9+
10+
set(VLFEAT_FOUND FALSE)
11+
12+
set(VLFEAT_ROOT "${vlfeat_SOURCE_DIR}")
13+
14+
find_package(vlFeat)
15+
if(NOT VLFEAT_FOUND)
16+
message(STATUS "Couldnt Find vlfeat, Installing Vlfeat")
17+
include(InstallvlFeat)
18+
message(STATUS "VLFEAT_ROOT: ${VLFEAT_ROOT}")
19+
20+
if(NOT VLFEAT_FOUND)
21+
message(FATAL_ERROR "Could not find vlFeat even after Installing, For more information visit https://www.vlfeat.org")
22+
return()
23+
else()
24+
message(STATUS "Found vlFeat")
25+
endif()
26+
27+
endif()
28+
29+
find_package(Python 3.8 REQUIRED
30+
COMPONENTS NumPy)
31+
32+
if(NOT Python_FOUND)
33+
message(FATAL_ERROR "Could not find Python")
34+
return()
35+
endif()
36+
37+
find_package(PythonLibs REQUIRED)
38+
39+
if(NOT PythonLibs_FOUND)
40+
message(FATAL_ERROR "Could not find PythonLibs")
41+
return()
42+
endif()
43+
44+
FetchContent_Declare(
45+
pybind11
46+
URL https://github.com/pybind/pybind11/archive/v2.3.0.tar.gz
47+
)
48+
49+
FetchContent_GetProperties(pybind11)
50+
51+
if(NOT pybind11_POPULATED)
52+
FetchContent_Populate(pybind11)
53+
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
54+
endif()
55+
56+
57+
find_package(Eigen3 REQUIRED)
58+
59+
60+
set(target "vlfeat_py")
61+
62+
pybind11_add_module(${target} MODULE
63+
source/vlfeat_py.h
64+
source/vlfeat_py.cpp
65+
source/sift/sift.cpp
66+
source/sift/dsift.cpp
67+
source/mser/mser.cpp
68+
)
69+
70+
71+
target_include_directories(${target}
72+
73+
PRIVATE
74+
${VLFEAT_INCLUDE_DIRS}
75+
${PYTHON_INCLUDE_DIRS}
76+
)
77+
78+
target_link_libraries(${target}
79+
PRIVATE
80+
${VLFEAT_LIBRARIES}
81+
${OpenCV_LIBS}
82+
${PYTHON_LIBRARIES}
83+
Python::NumPy
84+
Eigen3::Eigen
85+
)

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Royston E Tauro
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include README.md LICENSE
2+
global-include CMakeLists.txt cmake/*.cmake
3+
graft source

0 commit comments

Comments
 (0)