def show_data(): def showDate(date): tt = date.day() #s=self.cal.selectedDate().toString("yyyy-MM-dd dddd") ui.label_7.setText("the number of Feb %d is %d" % (tt, data[tt])) data = input_data() maxNum, maxDay, minNum, minDay, ave, mid = cal(data) QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling) app = QApplication(sys.argv) MainWindow = QMainWindow() ui = show_data_gui.Ui_MainWindow() ui.setupUi(MainWindow) # MainWindow.resize(760,440) MainWindow.show() ui.label.setText("minNum:" + str(minNum)) ui.label_2.setText("minDay:" + str(minDay)) ui.label_3.setText("maxNum:" + str(maxNum)) ui.label_4.setText("maxDay:" + str(maxDay)) ui.label_5.setText("average:" + str(ave)) ui.label_6.setText("median:" + str(mid)) ui.label_7.setText("") ui.pushButton.clicked.connect(chart) ui.calendarWidget.clicked.connect(showDate) sys.exit(app.exec_())
def create_output_image_and_desc(): create_bound_boxes, create_prop, create_rels, create_rules, get_field_size = input_data( ) description = scene_description(create_bound_boxes, create_prop, create_rels, create_rules, get_field_size) print(description) imf = draw_field(create_bound_boxes, get_field_size, -1, 1) show_image(imf)
def load_from_file(bound_boxes, v_boxes_new, file_name, v_boxes_old): create_bound_boxes, create_prop, create_rels, create_rules, get_field_size = input_data( ) description = scene_description(bound_boxes, create_prop, create_rels, create_rules, get_field_size) print(*description, sep='\n') save_desc_to_file(description, file_name) show_rectangles_grouping(v_boxes_new, v_boxes_old)
def chart(): data=input_data() y=[data[i] for i in range(1,30)] x=[str(i) for i in range(1,30)] plt.title("new patients of 2019-nCoV in China in each day of Febrary") plt.xlabel("date") plt.ylabel("number of new patients") plt.axis([0,31,0,16000]) plt.plot(x,y,"b") plt.show()
def _calculate_pos(ref_points): v_boxes = {} for index, ref_point in enumerate(ref_points): XtopLeft, YtopLeft = ref_point[0][0], ref_point[0][1] XbottomRight, YbottomRight = ref_point[1][0], ref_point[1][1] X_len = abs(XbottomRight - XtopLeft) Y_len = abs(YbottomRight - YtopLeft) obj = Obj(str(index), [YtopLeft, XtopLeft], [Y_len, X_len]) v_boxes[index] = obj create_bound_boxes, create_prop, create_rels, create_rules, get_field_size = input_data( ) description = scene_description(v_boxes, create_prop, create_rels, create_rules, get_field_size) print(description)
from InputData import input_data from calculation import cal from gui import gui from web import web web() data = input_data() maxNum, maxDay, minNum, minDay, ave, mid = cal(data) gui(maxNum, maxDay, minNum, minDay, ave, mid, data)
def load_from_file(bound_boxes, file_name): create_bound_boxes, create_prop, create_rels, create_rules, get_field_size = input_data() description = scene_description(bound_boxes, create_prop, create_rels, create_rules, get_field_size) print(description) save_desc_to_file(description, file_name)