提交 07160eb6 作者: 朱学凯

add mol_test

上级 e5d444a3
...@@ -260,6 +260,23 @@ def get_task(task_name): ...@@ -260,6 +260,23 @@ def get_task(task_name):
} }
return df_train, tokenizer_config return df_train, tokenizer_config
elif task_name.lower() == 'test_mol':
df_test = {"sps": './data/test/test_sps',
'seq': './data/test/test_protein_seq',
"smile": './data/test/test_smile',
"affinity": './data/test/test_ic50',
}
tokenizer_config = {"vocab_file": './config/vocab_mol.txt',
"vocab_pair": './config/drug_codes_chembl.txt',
"vocab_pair_p": './config/protein_codes_uniprot.txt',
"begin_id": '[CLS]',
"separate_id": "[SEP]",
"max_len": 595
}
return df_test, tokenizer_config
if __name__ == "__main__": if __name__ == "__main__":
......
from transformers import BertTokenizer from PIL import Image
from modeling_bert import BertForMaskedLM import os
import torch
import numpy as np
a = np.ones((5)) img_1_path = "E:\FIVN论文\照片\朱学凯.jpeg"
filename = "E:\FIVN论文\照片\朱学凯_gray.jpeg"
b = a[:4] def RGBtoGray(path, save):
print('----------------') # files = os.listdir(path)
\ No newline at end of file # for file in files:
# imgpath = path + '/' + file
# #print(imgpath)
#
img = Image.open(path).convert('L')
#resize将图像像素转换成自己需要的像素大小
# img = im.resize((512, 512))
# dirpath = filename
# file_name, file_extend = os.path.splitext(f)
# dst = os.path.join(os.path.abspath(dirpath), file_name + '.jpg')
img.save(save)
if __name__ == "__main__":
RGBtoGray(img_1_path, filename)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论