Skip to content

Samurai for Nuke allows you to generate masks from an image sequence, based on SAMURAI adaptation of SAM2

License

Notifications You must be signed in to change notification settings

Theo-SAMINADIN-td/NukeSamurai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



NukeSamuraiDemo.mp4

Introduction

Samurai for Nuke allows you to generate masks from an image sequence, based on SAMURAI adaptation of SAM2 Model for Zero-Shot Visual Tracking with Motion-Aware Memory.

💡 Additional features:

  • Mask export
  • EXR input/output
  • Frame range
  • Bounding Box Interface

🗒️ Requirements

  • Ubuntu>=20.04
  • Nuke>=15 (not tested on previous versions)
  • python>=3.10
  • torch>=2.3.1
  • torchvision>=0.18.1

🛠️ Installation

NS_InstallationGuide.mp4

1. Clone this repo into your Nuke/plugins folder (usually /home/nuke15.1/plugins/):

git clone https://github.com/Theo-SAMINADIN-td/NukeSamurai.git

Or Download this repo as ZIP file and extract it in your Nuke/plugins folder (Rename the folder correctly: NukeSamurai)

Your files should be structured like this:

Nuke
├── plugins/
│   ├── NukeSamurai/
│   │   ├── sam2_repo/
│   │   ├── scripts/
│   │   │   ├── demo.py
│   │   │   ├── nuke_samurai.py
│   │   ├── icons/
│   │   ├── init.py
│   │   ├── menu.py
│   ├── ...
│   ├── init.py 
│   ├── menu.py
├── ...

In Nuke/plugins/init.py (not NukeSamurai/init.py) add:

nuke.pluginAddPath("NukeSamurai")

In NukeSamurai/init.py (not Nuke/plugins/init.py) remove the "#" and add your environment path:

nuke.pluginAddPath("path/to/Python310/Lib/site-packages", addToSysPath=True)

2. Install dependencies

If torch>=2.3.1 and torchvision>=0.18.1 are not already installed:

pip install torch==2.3.1+cu118 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cu118

cd NukeSamurai/sam2_repo
pip install -e .
pip install -e ".[notebooks]"

For potential installation issues, check SAMURAI Issues and Solutions and SAM2 INSTALL.md

Install other requirements:

pip install matplotlib==3.7 tikzplotlib jpeg4py opencv-python lmdb pandas scipy loguru ninja

SAM 2.1 Checkpoint Download

cd checkpoints && \
./download_ckpts.sh && \
cd ..

👌 Launch Nuke!

About

Samurai for Nuke allows you to generate masks from an image sequence, based on SAMURAI adaptation of SAM2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published