diff --git a/plugins/In_one/main.py b/plugins/In_one/main.py index 1815799..c08f0b8 100644 --- a/plugins/In_one/main.py +++ b/plugins/In_one/main.py @@ -210,7 +210,7 @@ class InOnePlugin(BasicPlugin): def set_action(self): - basic_diff_method_in_one = QAction('总流程') + basic_diff_method_in_one = QAction('差分法') # ActionManager().change_detection_menu.addAction(basic_diff_method_in_one) ActionManager().unsupervised_menu.addAction(basic_diff_method_in_one) self.basic_diff_method_in_one = basic_diff_method_in_one @@ -498,6 +498,6 @@ def table_layer(pth,layer,name,send_message,dict): result_layer = ResultPointLayer(out_csv, enable=True, proj=layer.proj, geo=layer.geo) result_layer.result_path=dict - print(result_layer.result_path) + # print(result_layer.result_path) layer.layer_parent.add_result_layer(result_layer) send_message.emit('计算完成') \ No newline at end of file diff --git a/plugins/evaluation/main.py b/plugins/evaluation/main.py index 83ea072..5137f0d 100644 --- a/plugins/evaluation/main.py +++ b/plugins/evaluation/main.py @@ -6,7 +6,7 @@ from threading import Thread import numpy as np from rscder.gui.actions import ActionManager from rscder.plugins.basic import BasicPlugin -from rscder.gui.layercombox import RasterLayerCombox,ResultLayercombox +from rscder.gui.layercombox import RasterLayerCombox,ResultLayercombox, ResultPointLayerCombox from PyQt5.QtWidgets import QAction, QFileDialog, QDialog, QLabel, QHBoxLayout, QVBoxLayout, QPushButton from PyQt5.QtGui import QIcon from PyQt5.QtCore import Qt @@ -29,8 +29,9 @@ class EvalutationDialog(QDialog): self.setWindowTitle('精度评估') self.setWindowIcon(IconInstance().LOGO) - - self.layer_select = ResultLayercombox(self) + self.setMinimumWidth(500) + self.setMinimumHeight(150) + self.layer_select = ResultPointLayerCombox(self) self.gt_file = None gt_file_select_label = QLabel('真值文件:') @@ -42,7 +43,7 @@ class EvalutationDialog(QDialog): hbox1.addWidget(self.gt_file_select) hbox2 = QHBoxLayout() - # hbox2.addWidget(QLabel('二值化结果图层:')) + hbox2.addWidget(QLabel('二值化结果图层:')) hbox2.addWidget(self.layer_select) self.ok_button = QPushButton('确定', self) diff --git a/rscder/utils/project.py b/rscder/utils/project.py index e03e3dc..fdd43f1 100644 --- a/rscder/utils/project.py +++ b/rscder/utils/project.py @@ -493,12 +493,18 @@ class ResultPointLayer(BasicLayer): lyr.enabled = True lyr.fieldName = 'prob' lyr.placement = QgsPalLayerSettings.OverPoint - lyr.xOffset = 25 - lyr.yOffset = -2 + lyr.textFont = QFont('Times New Roman', 100) text_format = QgsTextFormat() text_format.setFont(lyr.textFont) - text_format.setSize(50) + if self.geo is None: + res = 1 + else: + res = self.geo[1] + # lyr.xOffset = 25 * res + # lyr.yOffset = -2 * res + text_format.setSize(50 * res) + text_format.setSizeUnit(QgsUnitTypes.RenderMapUnits) text_format.setColor(QColor('#FF0000')) # text_format.background().color = QColor('#000000') text_format.buffer().setEnabled(True) @@ -560,7 +566,7 @@ class ResultPointLayer(BasicLayer): if d[-1] == 0: point.setAttribute('prob', '') else: - point.setAttribute('prob', '%.2f'%(d[2])) + point.setAttribute('prob', '%.2f%%'%(d[2])) # point.setAttribute('id', i) features.append(point) layer.addFeatures(features) @@ -582,7 +588,7 @@ class ResultPointLayer(BasicLayer): if d[-1] == 0: feature.setAttribute('prob', '') else: - feature.setAttribute('prob', '%.2f'%(d[2])) + feature.setAttribute('prob', '%.2f%%'%(d[2])) self.layer.updateFeature(feature) else: feature = self.layer.getFeature(row+1) @@ -593,7 +599,7 @@ class ResultPointLayer(BasicLayer): if self.data[row][-1] == 0: feature.setAttribute('prob', '') else: - feature.setAttribute('prob', '%.2f'%(self.data[row][2])) + feature.setAttribute('prob', '%.2f%%'%(self.data[row][2])) self.layer.updateFeature(feature) self.layer.commitChanges() Project().result_table.show_result(self)