Skip to main content

No project description provided

Project description

NCUT

🌐Documentation | 🤗HuggingFace Demo

NCUT: Nyström Normalized Cut

Normalized Cut, aka. spectral clustering, is a graphical method to analyze data grouping in the affinity eigenvector space. It has been widely used for unsupervised segmentation in the 2000s.

Nyström Normalized Cut, is a new approximation algorithm developed for large-scale graph cuts, a large-graph of million nodes can be processed in under 10s (cpu) or 2s (gpu).


Installation & Quick Start

PyPI install, our package is based on PyTorch, please install PyTorch first

pip install ncut-pytorch

Minimal example on how to run NCUT, more examples in Documentation.

import torch
from ncut_pytorch import NCUT, rgb_from_tsne_3d

model_features = torch.rand(20, 64, 64, 768)

inp = model_features.reshape(-1, 768)  # flatten
eigvectors, eigvalues = NCUT(num_eig=100, device='cuda:0').fit_transform(inp)
tsne_x3d, tsne_rgb = rgb_from_tsne_3d(eigvectors, device='cuda:0')

eigvectors = eigvectors.reshape(20, 64, 64, 100)
tsne_rgb = tsne_rgb.reshape(20, 64, 64, 3)

paper in prep, Yang 2024

AlignedCut: Visual Concepts Discovery on Brain-Guided Universal Feature Space, Huzheng Yang, James Gee*, Jianbo Shi*,2024

Normalized Cuts and Image Segmentation, Jianbo Shi and Jitendra Malik, 2000

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

ncut_pytorch-1.0.12.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

ncut_pytorch-1.0.12-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file ncut_pytorch-1.0.12.tar.gz.

File metadata

  • Download URL: ncut_pytorch-1.0.12.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.16

File hashes

Hashes for ncut_pytorch-1.0.12.tar.gz
Algorithm Hash digest
SHA256 5d5d86ea76e0505fa65eaef29f7e32ce9798a38f3e61965cd030154efe8dd360
MD5 a4a149f1eadae397a0693016504f0652
BLAKE2b-256 39534e6ec0b6b91f5ef1a3059eeee9ebde5fe35ed39989d7b745674d2ed1e662

See more details on using hashes here.

File details

Details for the file ncut_pytorch-1.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for ncut_pytorch-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 9a5385e00c7a98ca6149b58309a1f977dcede02cc6cb605e043d4db8265aadc8
MD5 ef1c39ead9c22e5fcb753856a6b3ceda
BLAKE2b-256 35d30f770b61fc130cc1093043f4d03cb6211b2f2c3c43e895a4fd43649d50c5

See more details on using hashes here.

Supported by

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