Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Windows installation and execution instructions #300

Open
pjbull opened this issue Oct 10, 2023 · 4 comments
Open

Native Windows installation and execution instructions #300

pjbull opened this issue Oct 10, 2023 · 4 comments
Labels

Comments

@pjbull
Copy link
Member

pjbull commented Oct 10, 2023

Currently, we recommend Docker desktop or WSL for Windows.

It should be possible to run natively if yolox at our version pin can be compiled.

PR #222 had some initial work on this, but it was not generalizable to all Windows systems.

@lakik
Copy link

lakik commented Oct 17, 2023

This was the procedure that finally lead me to success:

.# WSL INSTALL ON WINDOWS 11
.# open powershell and install latest Ubuntu version
wsl --install

restart Windows
open Ubuntu

#-------------------------------------------------------------------------------
.# UBUNTU UPDATE
sudo apt update && sudo apt upgrade

sudo apt-get install build-essential
sudo apt install ffmpeg

#sudo apt update && sudo apt upgrade

#-------------------------------------------------------------------------------
.# PYTHON 3.9

sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9
sudo apt-get install python3.9-dev

.# check what is the default version
python3 --version

.# check installed versions
sudo ls /usr/bin/python*
.# make 3.9 as default
sudo ln -sf /usr/bin/python3.9 /usr/bin/python3
.# check
python3 --version

.# install missing package
sudo apt install python3.9-distutils

#-------------------------------------------------------------------------------------------------------------------------
.# ZAMBA
pip install https://github.com/drivendataorg/zamba/releases/latest/download/zamba.tar.gz

.# check success
pip show zamba

#-------------------------------------------------------------------------------------------------------------------------

@lywusa
Copy link

lywusa commented Nov 4, 2023

With WSL, I was able to run Zamba in the CLI, but how can I run it as a Python package? Not sure even after reading all tutorials. I have VS code.

@pjbull
Copy link
Member Author

pjbull commented Nov 4, 2023

From the documentation, you can see the basic example of using as a Python package. I copy that here:

from zamba.models.model_manager import predict_model
from zamba.models.config import PredictConfig

predict_config = PredictConfig(data_dir="example_vids/")
predict_model(predict_config=predict_config)

As linked from that documentation, the same things that you can pass to the CLI, you can pass into the PredictConfig. Those possible options are documented here. You can also override the default options for how videos get loaded (which is advanced functionality), using the VideoLoaderConfig.

So, for example, if I wanted to predict on a different directory called my_vids/ and change some of the prediction settings, I could do something like:

from zamba.models.model_manager import predict_model
from zamba.models.config import PredictConfig

predict_config = PredictConfig(
    data_dir="my_vids/",
    save_dir="zamba_output/",     # save to different directory
    model_name="european",        # run the model with European species
    weight_download_region="eu",  # download the model from the EU data center
)

predict_model(predict_config=predict_config)

If you save that script as my_script.py running it is as easy as running python my_script.py, assuming you have Python installed.

@lywusa
Copy link

lywusa commented Nov 18, 2023

Thanks for your reply. I have Windows 11+WSL/VS Code and have to put everything under if __name__ == '___main__': to run correctly .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants