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.1.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ncut_pytorch-1.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 01471d08380bf7621d2225ea9cca159da0495edd88bd346cb8cdecb302772ba8
MD5 59e4bc1ed10394c8682c6a9baa1e89cf
BLAKE2b-256 6ef71cd503d50ecae83a9273cd424e80a3315406bdcc6ebbdeecdc92a9a94f80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ncut_pytorch-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.16

File hashes

Hashes for ncut_pytorch-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa12c72bd46c32ca9fe900186db03d9da7ac6a940ade17bb78b671f1d0795485
MD5 2c6bb790cd63462a6b618bc142c97592
BLAKE2b-256 5cd1516241f7f75b591dc9a435cddc1192b698cfbcee55efec4908f5efd4d45e

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