DSAM-Seg: Towards Limited Labeled Data and Cross-Region Road Extraction by Parameter-Efficient Transfer Learning
-2026/1/21-30 Code is being organized and uploaded.
-Pytorch 2.7.1
git clone https://github.com/Winkness/Segment.git
cd Segmentconda create -n DSAM-Seg python==3.10
conda activate DSAM-Seg
pip install -r requirements.txtcd Process
python split.pycd Segment
CUDA_VISIBLE_DEVICES="1" \
python train.py --hiera_path "/insert your path/pretrained-SAM/sam2_hiera_large.pt" \
--dinov3_path "./insert your path/dinov3_vitl16_pretrain_sat493m-eadcf0ff.pth" \
--train_image_path "/insert your train dataset path/images/" \
--train_mask_path "/insert your train dataset path/masks/" \
--save_path "./save" \
--epoch 20 \
--lr 0.0002 \
--batch_size 2CUDA_VISIBLE_DEVICES="1" \
python test.py \
--checkpoint "/insert your model path/DSAN-Seg-20.pth" \
--test_image_path "/insert your test dataset path/img/" \
--test_gt_path "/insert your test dataset path/gt/" \
--save_path "./masks"#Pretrained Model segment anything 2 DINOV3 #Datasets The Deepglobe dataset The Massachusetts dataset The GRSet dataset #Baseline SAM2-UNeXT
