Mask2Former install

========
Linux:
conda activate pytorch2

git clone https://github.com/facebookresearch/detectron2.git
cd detectron2
pip install -e .

git clone https://github.com/facebookresearch/Mask2Former.git
cd Mask2Former
pip install -r requirements.txt

# 为 MSDeformAttn 编译 CUDA 内核
cd mask2former/modeling/pixel_decoder/ops
sh make.sh
========


========
Windows:
设置环境变量:
E:\dev\Qt5.14.2\Tools\mingw730_64\bin

cd D:\detectron2_windows
pip install -e .

cd D:\Mask2Former_windows
pip install -r requirements.txt

Use git-bash:
cd "E:\miniconda3\Scripts"
source activate
conda activate pytorch2
cd "D:\Mask2Former_windows\mask2former\modeling\pixel_decoder\ops"
sh make.sh
========


下载预训练模型
https://github.com/facebookresearch/Mask2Former/blob/main/MODEL_ZOO.md

cd demo
python demo.py --config-file ../configs/coco/instance-segmentation/maskformer2_R50_bs16_50ep.yaml --input input1.jpg --output ./output/ --opts MODEL.WEIGHTS ../model_final_3c8ec9.pkl
python demo.py --config-file ../configs/coco/instance-segmentation/maskformer2_R50_bs16_50ep.yaml --input F:/mask/input_imgs/1000068_p4_upper.jpg --output ./output/ --opts MODEL.WEIGHTS ../output/model_0004999.pth

python train_net.py --num-gpus 1 --config-file ./configs/coco/instance-segmentation/maskformer2_R50_bs16_50ep.yaml --resume SOLVER.IMS_PER_BATCH 3 SOLVER.BASE_LR 0.0001
python train_net.py --num-gpus 1 --config-file ./configs/coco/instance-segmentation/swin/maskformer2_swin_large_IN21k_384_bs16_100ep.yaml --resume SOLVER.IMS_PER_BATCH 3 SOLVER.BASE_LR 0.0001
python train_net.py --num-gpus 1 --config-file ./configs/coco/instance-segmentation/swin/maskformer2_swin_small_bs16_50ep.yaml --resume SOLVER.IMS_PER_BATCH 2 SOLVER.BASE_LR 0.0001

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

19 − 3 =