conda create -n moseq-detectron python=3.8
conda activate moseq-detectron
Install using https://pytorch.org/ to insure you get the correct versions. Something along the lines of:
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
python -m pip install git+https://github.com/facebookresearch/detectron2.git
conda install -c conda-forge ffmpeg
git clone https://github.com/tischfieldlab/moseq2-detectron-extract.git
pip install -e moseq2-detectron-extract
moseq2-detectron-extract generate-dataset /path/to/session.tar.gz
moseq2-detectron-extract train /path/to/annotations.json /path/to/model-output
moseq2-detectron-extract infer /path/to/model/directory/ /path/to/session.tar.gz
moseq2-detectron-extract compile /path/to/model-output /path/to/annotations.json --evaluate
You can check the COCO evaluation statistics afterward to ensure the model was exported successfully
moseq2-detectron-extract extract /path/to/model/directory/ /path/to/session.tar.gz