Skip to content

Latest commit

 

History

History
61 lines (38 loc) · 2.72 KB

my_install.md

File metadata and controls

61 lines (38 loc) · 2.72 KB

Steps to install this modified AdelaiDet folder

Create date: 2024/02/18. Test server: tesla.

1. Clone this folder

Git clone this GitHub folder.

Command: git clone https://github.com/Spritea/BoxMOTS.git

2. Create a conda env

Command: conda create -n myenv python=3.8

3. Install PyTorch 1.8.0 with cuda 11.1

Command: conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge

4. Install Detectron 2 for PyToch 1.8 and cuda 11.1

Command: python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.8/index.html

5. Install skimage 0.21

Because the default setting will install new version skimage 0.22, which will report error when we build this folder.

Command: pip install scikit-image==0.21

6. Build the AdelaiDet folder

Command: python setup.py build develop

7. Test the installation by inference

7.1 Download the pretrained checkpoint

The ckpt link is updated to below in the latest AdelaiDet GitHub repo.

Command: wget https://huggingface.co/tianzhi/AdelaiDet-FCOS/resolve/main/FCOS_R_50_1x.pth?download=true -O fcos_R_50_1x.pth

7.2 Install pillow 9.5.0

The default installed latest pillow version 10.2.0 will report error AttributeError: module 'PIL.Image' has no attribute 'LINEAR', when we run the inference command below.

We need to install old version pillow to fix this issue.

Command: pip install pillow==9.5.0

7.3 Install opencv-python

OpenCV is needed to run the inference command below.

Command: pip install opencv-python

7.4 Run the inference command

Follow the guidance in AdelaiDet GitHub repo to run inference. The image coco_val_0885.jpg is collected from the COCO dataset by cws. The result will appear in a pop-up window, if we run the command in MobaXterm.

Command: python demo/demo.py --config-file configs/FCOS-Detection/R_50_1x.yaml --input coco_val_0885.jpg --opts MODEL.WEIGHTS fcos_R_50_1x.pth

8. Modify Detectron 2 package files

Follow my_code/change_detectron2 to modify/overwrite Detectron 2 package files.

9. Modify pycocotools package file

Follow my_code/change_pycocotools to modify/overwrite the pycocotools package file.

10. Install rapidfuzz 2.0.11

The new version rapidfuzz>=3.0.0 do not have string_metric anymore. We need to install an older one. The rapidfuzz version on the server-4 is 2.0.11.

Command: pip install rapidfuzz==2.0.11

This GitHub issue says pip install rapidfuzz==2.15.1 also works, but I have not tried yet.