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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ncut_pytorch-1.0.11.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.11.tar.gz
Algorithm Hash digest
SHA256 40ebeb1e96797afd9d19414bf4a3bb2c49d5291757c770e9e910ab9d6ba11730
MD5 eab050326925ce14e47bb64e630a4fea
BLAKE2b-256 50cf6647350ebd79b3cfee1c3334da57a57ca553f054ee4e76590a6c6d17e851

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncut_pytorch-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 ffbad846e0b5fb772eac873153fcdf2dec019002aef61eb5c3931546046defef
MD5 c22096eb5a5a0eb8bbfab05432c3a8a8
BLAKE2b-256 24bb05538de3dee63548b10f335a45ec324c7838d8060cdb51ed3b117558560d

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