Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor pysift as a library with install #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/


.pytest_cache

.benchmarks/
tests/benchmarks/data/*
tests/fixtures/mask*
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ PythonSIFT has been reimplemented (and greatly improved!) in Python 3. You can f

Last tested successfully using `Python 3.7.6` and `OpenCV-Python 4.2.0`.

## Installation

```
$ git clone https://github.com/rmislam/PythonSIFT.git
$ cd PythonSIFT
$ pip install -U pip
$ pip install -e .[examples]
```

## Examples

```bash
cd examples
python template_matching_demo.py
```

## Usage

```python
Expand Down
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

MIN_MATCH_COUNT = 10

img1 = cv2.imread('box.png', 0) # queryImage
img2 = cv2.imread('box_in_scene.png', 0) # trainImage
img1 = cv2.imread('img/box.png', 0) # queryImage
img2 = cv2.imread('img/box_in_scene.png', 0) # trainImage

# Compute SIFT keypoints and descriptors
kp1, des1 = pysift.computeKeypointsAndDescriptors(img1)
Expand Down
7 changes: 7 additions & 0 deletions pysift/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""pysift."""

import pkg_resources

from pysift.pysift import computeKeypointsAndDescriptors

version = pkg_resources.get_distribution(__package__).version
File renamed without changes.
46 changes: 46 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""Setup for pysift."""

from setuptools import find_packages, setup

with open("README.md") as f:
readme = f.read()

# Runtime requirements.
inst_reqs = [
"numpy",
"opencv-python",
]

extra_reqs = {
"test": ["pytest", "pytest-benchmark", "pytest-cov"],
"dev": ["pytest", "pytest-benchmark", "pytest-cov"],
"examples": ["matplotlib"],
"docs": ["mkdocs"],
}

setup(
name="pysift",
version="0.0.1",
python_requires=">=3.5",
description="Python implementation of the SIFT algorithm.",
long_description=readme,
long_description_content_type="text/markdown",
classifiers=[
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.6",
"Topic :: Scientific/Engineering",
],
keywords="Image processing",
author="Russ Islam",
author_email="[email protected]",
url="https://github.com/rmislam/PythonSIFT",
license="MIT",
packages=find_packages(exclude=["ez_setup", "examples", "tests"]),
include_package_data=True,
zip_safe=True,
install_requires=inst_reqs,
extras_require=extra_reqs,
)