Skip to main content

A package for template matching using Torch

Project description

hd-tmf

A high-dimensional template matching framework based on PyTorch.

Installation

pip install hd-tmf

Usage

import numpy as np
from hd_tmf import tmf

Example

# generate a random template
tmp = np.random.rand(10, 20, 20)
# generate a random image
data = np.random.rand(1000, 1000)
# calculate the cross-correlation between the template and the image
corr = tmf(tmp, data, step=1, device='cpu', moves=[], batch_size=-1, save_memory=False, max_workers=4)

Parameters

  • tmp (numpy.ndarray or torch.Tensor): The template to be matched.
  • data (numpy.ndarray or torch.Tensor): The image to search for the template.
  • step (int, optional): The step size of the convolution. Defaults to 1.
  • device (str, optional): The device to perform the computation on. Defaults to 'cpu'.
  • moves (list, optional): A list of moves to apply to the template before matching. Defaults to [].
  • batch_size (int, optional): The batch size to use for the computation. Defaults to -1.
  • save_memory (bool, optional): Whether to use half-precision floating point numbers to save memory. Defaults to False.
  • max_workers (int, optional): The maximum number of worker threads to use for the computation. Defaults to 4.

Returns

  • numpy.ndarray: The cross-correlation between the template and the image.

License

Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Hough-TMF-0.0.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Hough_TMF-0.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file Hough-TMF-0.0.1.tar.gz.

File metadata

  • Download URL: Hough-TMF-0.0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for Hough-TMF-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ba01e80be4f8a03f6df5acb26b5257bc0c348e3332048b55f4135c68163d0dca
MD5 b4b4c635baa02e692e01f7fb3248e9f6
BLAKE2b-256 6ae7d9cf2578df1ca46fc667b952cfe67dbf744755bf02b2c3a9aa69257e47f6

See more details on using hashes here.

File details

Details for the file Hough_TMF-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: Hough_TMF-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for Hough_TMF-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1bea1c48abb09a6832eed30d252452ff8957c34ec1c8081b2b1aaffab830c0a
MD5 1db5438c3586d4e357770f6bbe5eeafd
BLAKE2b-256 9ae4be906e3169682b2cb6341027aecf8df4c3168eab562e0a235414cb99bbf6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page