File size: 1,263 Bytes
3b2b066
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
__author__ = 'Rio'
from yacs.config import CfgNode as CN
config = CN()
config.root = os.path.dirname(os.path.abspath(__file__))
config.models = os.path.join(config.root, '../Model/breast_model_best.pth')

config.dataset_name = 'Mammary'
config.distiller_num = 18 # liver:18; Mamary:18; Thyroid:5
config.jieba_dir = os.path.join(config.root, '../utils/key_technical_words.txt')
config.image_dir = os.path.join(config.root, '../Data_demo/Images')
# config.ann_path = 'E:/Datasets/Ultrasound/Data/new_Mammary2.json'
config.ann_path = os.path.join(config.root, '../Data_demo/Breast.json')

config.dict_pth = os.path.join(config.root, '../utils/breast_dict.txt')

config.max_seq_length = 150

config.visual_extractor = 'resnet101'
config.visual_extractor_pretrained = True

config.d_model = 512
config.d_ff = 512
config.d_vf = 2048
config.num_heads = 8
config.num_layers = 3
config.dropout = 0.1
config.logit_layers = 1
config.bos_idx = 0
config.eos_idx = 0
config.pad_idx = 0
config.use_bn = 0
config.drop_prob_lm = 0.5

config.sample_n = 1
config.output_logsoftmax = 1
config.decoding_constraintt = 0

config.seed = 9233

# text_image_losses.py
config.cuda = True
config.threshold = 3
config.nhidden = 512