test(sar): 更新模型并测试sar数据集

- 更新模型权重文件路径
- 修改测试数据集为仅使用sar数据集
- 更改模型名称描述
This commit is contained in:
zjut 2024-11-15 17:43:21 +08:00
parent 4f805c2449
commit 5847dc5771
2 changed files with 4 additions and 3 deletions

1
net.py
View File

@ -426,6 +426,7 @@ class Restormer_Encoder(nn.Module):
self.baseFeature_sar = BaseFeatureExtractionSAR(dim=dim) self.baseFeature_sar = BaseFeatureExtractionSAR(dim=dim)
self.detailFeature_sar = DetailFeatureExtractionSAR() self.detailFeature_sar = DetailFeatureExtractionSAR()
def forward(self, inp_img,is_sar=False): def forward(self, inp_img,is_sar=False):
inp_enc_level1 = self.patch_embed(inp_img) inp_enc_level1 = self.patch_embed(inp_img)
out_enc_level1 = self.encoder_level1(inp_enc_level1) out_enc_level1 = self.encoder_level1(inp_enc_level1)

View File

@ -17,11 +17,11 @@ current_time = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
os.environ["CUDA_VISIBLE_DEVICES"] = "0" os.environ["CUDA_VISIBLE_DEVICES"] = "0"
ckpt_path= r"/home/star/whaiDir/PFCFuse/models/whaiFusion10-08-16-20.pth" ckpt_path= r"/home/star/whaiDir/PFCFuse/models/whaiFusion11-15-09-38.pth"
for dataset_name in ["TNO","RoadScene"]: for dataset_name in ["sar"]:
print("\n"*2+"="*80) print("\n"*2+"="*80)
model_name="PFCFuse " model_name="base 基础,没有修改 "
print("The test result of "+dataset_name+' :') print("The test result of "+dataset_name+' :')
test_folder = os.path.join('test_img', dataset_name) test_folder = os.path.join('test_img', dataset_name)
test_out_folder=os.path.join('test_result',current_time,dataset_name) test_out_folder=os.path.join('test_result',current_time,dataset_name)