-
Notifications
You must be signed in to change notification settings - Fork 4
command line
Amira Burns edited this page Feb 20, 2025
·
1 revision
Deploy CameraTrapDetector Version 3 Models on the command line for faster runtime and optimal use with GPU or HPC systems.
Prerequisites: please confirm you have Python installed by opening a terminal and typing python or py. If you do not see a message confirming a Python version, download and install Python v>=3.5 before proceeding.
- Download the model zip folder named species_v3_cl and containing command line deployment files.
- Unzip the folder in an accessible location. Confirm you have the following files: deploy_model_v3.py, requirements.txt, and weights.pt
- Open a terminal.
- Navigate to the model folder using the cd command:
cd /path/to/dir/species_v3_cl - Create a new python environment with the command:
python -m venv <environment_name>replacing the environment name with one of your choosing. For this example, we will proceed with the name deploy_ctd
python -m venv deploy_ctd - Activate the new environment
a. Windows:deploy_ctd/Scripts/activate
b. Mac / Linux:source deploy_ctd/bin/activate - Install required packages from the requirements.txt file (now is a good time to take a break while packages install):
pip install -r requirements.txt - Review the script arguments with the command:
python deploy_model_v3.py –help
- Run the model with desired arguments as detailed in the output from Step 8. Note that model_file and image_dir are required arguments, all other arguments are optional. See below for sample output of model run on 6 test images, which completed on a single CPU in under 2 seconds.