MagnumVD / RotoForge-AI

An implementation of SAM-HQ + some other stuff to make rotoscoping in blender fast af
https://ko-fi.com/s/5025cf0a06
Other
40 stars 1 forks source link

Use requirements.txt to download python packages #2

Closed MagnumVD closed 4 months ago

MagnumVD commented 6 months ago

Using a requirements.txt to download the python packages needed should be better since it allows for more fine control and is faster since it'd remove the redundancy of pytorch. Currently it's downloaded once with timm and then has to be installed a second time to work with cuda. By just defining everything manually that could be skipped.

3pointedit commented 6 months ago

Would this mean that I could manually download the folders for Mac?

MagnumVD commented 6 months ago

Would this mean that I could manually download the folders for Mac?

Theoretically you can manually download the folders on all systems. Because you can manually set the dependency directory in blender, you could in theory even download the dependencies onto a USB drive and just set the deps dir after you plug it in on another machine. As long as the files are there, it should work.

3pointedit commented 6 months ago

Is there a download path revealed somewhere to do this, will the addon only perform the download automatically ?

MagnumVD commented 6 months ago

What do you mean by only perform the download automatically?

You can get the models from here: https://huggingface.co/lkeab/hq-sam/tree/main

The downloaded pypi packages are: timm, segment-anything-hq And for pytorch you'll need: torch==2.2.2, torchvision==0.17.2

MagnumVD commented 6 months ago

I'm thinking you maybe have a wrong idea about what a requirements.txt means in the context. That would be an internal file which I give pip to have fine control during the installation of multiple packages.

That way I can remove redundancies such as numpy and pytorch which I currently need to install 2 times because timm comes with it, but in the wrong version. And the whole install would be both faster and more efficient.