예제 #1
0
 def __init__(self):
     super().__init__()
     self.ui = Ui_AboutDialog()
     self.ui.setupUi(self)
     text = "Please compile a license rollup by running python3 -m ori3nt8.gui.utils.generate_license_rollup"
     rollup_path = resource_path() / "license_rollup.txt"
     if rollup_path.exists():
         text = "Licenses:\n\n" + rollup_path.read_text()
     self.ui.versionLabel.setText("Ori3nt8 " + get_version_tag())
     self.ui.licenseTextArea.setPlainText(text)
예제 #2
0
    def __init__(self, injector: Annotated[Injector, Inject]):
        super().__init__()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        appIcon = QIcon(str(resource_path() / "ori3nt8.svg"))
        self.setWindowIcon(appIcon)

        self.ui.actionOpen_directory.triggered.connect(self.select_and_open_directory)
        self.ui.actionNext.triggered.connect(lambda: self.next_item())
        self.ui.actionPrevious.triggered.connect(self.previous_item)

        self.image_widget = injector.inject(ImageContainerWidget)(self.update_status_bar)
        self.ui.imageLayout.addWidget(self.image_widget, 1, 1)
        self.ui.actionRotate_clockwise.triggered.connect(self.image_widget.rotate_clockwise)
        self.ui.actionRotate_counterclockwise.triggered.connect(self.image_widget.rotate_counterclockwise)
        self.ui.actionAutomatically_apply.toggled.connect(self.image_widget.set_apply_automatically)
        self.ui.actionApply_suggested_orientation.triggered.connect(self.image_widget.apply_suggested_orientation)
        self.ui.actionWebsite.triggered.connect(self.launch_website)
        self.ui.actionAbout.triggered.connect(self.launch_about)

        self.file_tree_view_navigator = ModelIndexNavigator.for_selecting_current_item_in_tree_view(
            self.ui.fileTreeView
        )
예제 #3
0
 def __init__(self):
     onnx_model = onnx.load(str(resource_path() / "network.onnx"))
     self.rep = backend.prepare(onnx_model, device="CPU")
예제 #4
0
def write_version_tag(version_tag_path: Path = None):
    if version_tag_path is None:
        version_tag_path = resource_path() / "version_tag.txt"
    version_tag_path.write_text(get_version_information_from_git())
예제 #5
0
def get_version_tag(version_tag_path: Path = None):
    if version_tag_path is None:
        version_tag_path = resource_path() / "version_tag.txt"
    if version_tag_path.exists():
        return version_tag_path.read_text()
    return get_version_information_from_git()