File size: 1,817 Bytes
eba0a14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
_base_ = './base_config.py'

# model settings
# 使用TinyCLIP+ProxyCLIP模型进行分割
# 模型: TinyCLIP-ViT-39M-16-Text-19M
# VFM: DINO-B-8
# 模式: proxyclip

model = dict(
    name_path="configs/proxyclip/cls_context59.txt",
    vfm_model="dino-B-8",  # Options: 'sam-B', 'sam-L', 'dinov2-B', 'dinov2-L', 'dino-B-8', 'dino-B-16'
    type="TinyCLIPProxySegmentation",
    clip_type="TinyCLIP-ViT-39M-16-Text-19M",
    checkpoint="/mnt/SSD8T/home/wjj/code/DeCLIP_private/checkpoints/TinyCLIP-ViT-39M-16-Text-19M-YFCC15M.pt",
    mode="proxyclip",  # Use proxyclip mode
    beta=1.2,  # ProxyCLIP beta parameter
    gamma=3.0,  # ProxyCLIP gamma parameter
    prob_thd=0.0,
    logit_scale=40,
    slide_stride=112,
    slide_crop=336,
)

# dataset settings
dataset_type = "PascalContext59Dataset"
data_root = "/mnt/SSD8T/home/wjj/dataset/VOCdevkit/VOC2010"

test_pipeline = [
    dict(type="LoadImageFromFile"),
    dict(type="Resize", scale=(2048, 336), keep_ratio=True),
    dict(type="LoadAnnotations", reduce_zero_label=True),
    dict(
        type="PackSegInputs",
        meta_keys=(
            "img_path",
            "seg_map_path",
            "ori_shape",
            "img_shape",
            "pad_shape",
            "scale_factor",
            "flip",
            "flip_direction",
            "reduce_zero_label",
            "resize_shape",
        ),
    ),
]

test_dataloader = dict(
    batch_size=1,
    num_workers=4,
    persistent_workers=True,
    sampler=dict(type="DefaultSampler", shuffle=False),
    dataset=dict(
        type=dataset_type,
        data_root=data_root,
        data_prefix=dict(
            img_path="JPEGImages", seg_map_path="SegmentationClassContext"
        ),
        ann_file="ImageSets/SegmentationContext/val.txt",
        pipeline=test_pipeline,
    ),
)