Skip to main content

Distinguish behavioral clusters Toolbox

Project description

CASTLE

PyPI version Open In Colab

CASTLE integrates the strengths of visual foundation models trained on large datasets possess open-world visual concepts, including Segment Anything (SA), DeAOT, and DINOv2, for one-shot image segmentation and unsupervised visual feature extraction. Furthermore, CASTLE employs unsupervised multi-stage and/or multi-layer UMAP clustering algorithms to distinguish behavioral clusters with unique temporal variability.

Install

Now we only support colab(with GPU) and Ubuntu 22.04 (with NVIDIA GPU).

Step 1 Install CASTLE Core Function

pip install torch==2.3.0+cu121 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

pip install castle-ai

Step 2 Install xFormer and GPU Version of UMAP (Optional for Speed Up)

For CUDA 12 Users

pip install -U xformers --index-url https://download.pytorch.org/whl/cu121
pip install -U cudf-cu12 cuml-cu12 --extra-index-url=https://pypi.nvidia.com 

Step 3 Download Web UI

git clone https://github.com/CASTLE-ai/castle-ai.git

Step 4 Download Pretrained Model

cd castle-ai/
mkdir ckpt

Then, download the models from the web by copying the links to the Chrome browser and downloading them.

https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth
https://dl.fbaipublicfiles.com/dinov2/dinov2_vitb14/dinov2_vitb14_reg4_pretrain.pth
https://drive.google.com/file/d/1g4E-F0RPOx9Nd6J7tU9AE1TjsouL4oZq/edit
https://drive.google.com/file/d/1QoChMkTVxdYZ_eBlZhK2acq9KMQZccPJ/edit

Afterward, place them into the ckpt folder.

castle-ai
├── castle
└── ckpt
    ├── dinov2_vitb14_reg4_pretrain.pth
    ├── R50_DeAOTL_PRE_YTB_DAV.pth
    ├── sam_vit_b_01ec64.pth
    └── SwinB_DeAOTL_PRE_YTB_DAV.pth

Run

python app.py

Reference

We would like to express our gratitude for the assistance received from the following projects during the development of this project.

Segment Anything

DeAOT & Segment-and-Track-Anything

DINOv2

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

castle_ai-0.0.14.tar.gz (128.1 kB view details)

Uploaded Source

Built Distribution

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

castle_ai-0.0.14-py2.py3-none-any.whl (162.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file castle_ai-0.0.14.tar.gz.

File metadata

  • Download URL: castle_ai-0.0.14.tar.gz
  • Upload date:
  • Size: 128.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for castle_ai-0.0.14.tar.gz
Algorithm Hash digest
SHA256 ea5fa442e50402b5d680dca0ff1a23c347ffe5415e0d775eac3243a8c57e0a58
MD5 9be1bf26e8e91c7c6c8c13ba49062f42
BLAKE2b-256 48685449124ba8ded01ad93bc69798428a881ef69fc8301164c69d91b35f73d3

See more details on using hashes here.

File details

Details for the file castle_ai-0.0.14-py2.py3-none-any.whl.

File metadata

  • Download URL: castle_ai-0.0.14-py2.py3-none-any.whl
  • Upload date:
  • Size: 162.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for castle_ai-0.0.14-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 06590a2b38a7bbb4ecb7cd4cf6bf4094651a47a77d5d3dd7f491c17abe501cca
MD5 95c322a83e96b244653d800ba18a7feb
BLAKE2b-256 556975d1a86d1141f7621f02033cbb66e2fbeddfdbccdac8de7c714f824276aa

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