Matanyone using sammiroto

you’re correct - there are different ways to setup virtual environments for python.
this is an alternative if conda/anaconda isn’t functioning as expected.

1 Like

@kyleobley, not to be that guy, but you’re activating the 3.12 env with conda activate nameof3.12env and going through the rest of the install process in that env correct? The head of your prompt in the shell would have the 3.12 env name pre appended in parentheses to show its active.

Just gave it a go… M4 Max on Sequoia 15.3.2

conda create -n sammieroto python=3.12 -y
conda activate sammieroto
bash install_dependencies.sh 
bash run_sammie.command

…were the 4 commands to get it going from scratch. I picked a 3.12 env just because I though that’s what was required, but the 1.4 install from git only mentions higher than 3.10.

3 Likes

…runs on Python 3.13.2 & PyTorch2.8

1 Like

@cnoellert Interesting. That’s exactly what I did when I gave it a 2nd go. I think my problem stems from bungling my way around trying to understand conda and I didn’t start fresh for round 2. Looks like that’s what I’ll have to do. I’m sure something’s gotten mixed up somewhere.

I saw the 3.12 (max) requirement somewhere…maybe PyTorch.

Anyways, thank you for your help. I’ll give it a go when I have a moment.

2 Likes
  • Anaconda is a distribution of Python that includes package management.

  • Conda is a package and environment manager that comes with Anaconda but can also be used independently to manage dependencies across different programming languages.

  • Pyvenv/venv is a lightweight Python module for creating isolated environments to avoid dependency conflicts in projects.

  • Docker is a platform that uses containers to package applications and their dependencies, ensuring they run consistently across different environments.

  • Virtual machines emulate entire operating systems, providing isolated environments that act as separate computers, complete with their own virtualized hardware.

2 Likes

This looks really promising:

3 Likes

I got it working on an M2 with Python 3.13 via pyenv.
I’m on 14.7.6, though.

-Ted

Finally got around to installing and testing it.

Instructions here Matanyone using sammiroto - #66 by cnoellert worked perflectly. Install Anaconda and then these 4 commands, on a Rocky 9.5 system.

Tested it with a 4K and an 8K clip. Results are pretty darn good as noted.

High res clips (8K) took a bit longer to load into the segmentation, but processing was decently fast. Also noticed that the VRam usage between 4K/8K was identical - fluctuating between 30-50% on an A6000.

Workflow worked just as demoed in the video at the top of the thread.

This was on the latest version of both - Anaconda 2024-10.1 w/ Python 3.12 and Sammie Roto 1.4.

In a quick test, I let the SAM model track all the way through and rendered out the segmentation mask. In itself not a bad result at all by comparison to some other tools.

Then I rendered out the Matanyone matte the same way. They’re stacked in Frame, so if you use comparison mode you can see them side-by-side.

The difference in hair detail, eye lashes, and the earrings are quite notable and exciting.

2 Likes

WOW that’s impressive. How long would / did it take on a mac to render that matte.

Not sure, haven’t tried it on a Mac. On the Linux system it took a few minutes. Didn’t time it. Want to say 5min max.

Hi John, it’s super easy and pretty fast to generate fine mattes out of previous selected subjects on mac. Very useful

Does the original material was shot on a green screen?

No, it was just a gray seamless. I can’t show the original here, as it’s unreleased work.

1 Like

Is there a way to limit the memory usage in SAMMIE? For example, my Mac has only 64GB in total.

So I started fresh and did what you suggested and still no dice. No matter what I do, I can’t seem to get pytorch 2.7.0. Best I can do is 2.5.1. I’m a bit confused how it just works for you but not for me doing the exact same thing.

What’s strange is 2.7.0 is installed outside of the new environment.

1 Like

Can’t speak to the Mac, since I did it on Linux. But the one place where I can see a possible trip wire…

In one of the install steps of Anaconda it asks you whehter it should auto-activate the environment and change your .bashrc. I told it not do that, since I didn’t want to impact the rest of the system.

But as a result, before running sammieroto, I need to activate Anaconda

alias activateconda=‘eval “$(/home/allklier/anaconda3/bin/conda shell.bash hook)”’

I added that as an alias to my bashrc, and obviously your path would be different. But you need to do this activation for the shell you’re going to run sammieroto from, the activation of Anaconda is specific to that shell instance (unless you allowed it to make the global change).

Not sure if that’s the issue you have, but worth checking.

I first installed miniconda and it adds the required bits to .zshrc as well as .bash_profile. Then I used conda to create the environment and activate it just like Chris mentioned. You see the environment in the shell. I just can’t get a Python 3.12 environment to install PyTorch 2.7.0 via pip3.

conda create -n sammie (or whatever name you want give it) python=3.13
conda activate sammie (or whatever name you use)

pip install --upgrade --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu

cd sammie (or whatever name you use)

python app.py

works well…

3 Likes