diff --git a/README.md b/README.md index 81eae4b..355530c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 DigestAI =========================== +

DigestAI is a powerful model analysis tool that extracts insights from your models, enabling optimization and direct modification.

[![python](https://img.shields.io/badge/python-3.10-blue)](https://github.com/onnx/digestai) @@ -16,11 +17,12 @@ DigestAI ![logo](src/digest/assets/images/banner.png) --- +
DigestAI is a powerful model analysis tool that extracts insights from your models, enabling optimization and direct modification. -**Get started quickly!** Download the DigestAI installer directly from [link to download page]. +**Get started quickly!** Download the DigestAI executable directly from [link coming soon]. **Developers: Contribute to DigestAI** Follow the installation instruction below to get started. @@ -65,19 +67,18 @@ The following steps are recommended because they are reproducible, however, ther **Workflow** 1. **Open Qt Designer:** - - **Activate Conda Environment:** Ensure your `digest` Conda environment is activated. - - **Launch:** Run `pyside6-designer.exe` from your terminal. + * **Activate Conda Environment:** Ensure your `digest` Conda environment is activated. + * **Launch:** Run `pyside6-designer.exe` from your terminal. 2. **Work with UI Files:** - - Open any existing UI file (`.ui`) from `src/digest/ui`. - - Design your interface using the drag-and-drop tools and property editor. - - Resource Files (Optional): If your UI uses custom icons, images, or stylesheets, please leverage the Qt resource file (`.qrc`). This makes it easier to manage and package resources with the application. - - Please add any new `.ui` files to the `.pylintrc` file. + * Open any existing UI file (`.ui`) from `src/digest/ui`. + * Design your interface using the drag-and-drop tools and property editor. + * Resource Files (Optional): If your UI uses custom icons, images, or stylesheets, please leverage the Qt resource file (`.qrc`). This makes it easier to manage and package resources with the application. + * Please add any new `.ui` files to the `.pylintrc` file. 3. **Recompile UI Files (After Making Changes):** - - From your terminal, navigate to the project's root directory. - - Run: `python src/digest/compile_digest_gui.py` - + * From your terminal, navigate to the project's root directory. + * Run: `python src/digest/compile_digest_gui.py` ## Building EXE for Windows Deployment @@ -114,8 +115,9 @@ pytest test/test_gui.py ``` ## License -This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE.txt) file for details. +This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE.txt) file for details. ## Copyright -Copyright(C) 2024 Advanced Micro Devices, Inc. All rights reserved. \ No newline at end of file + +Copyright(C) 2024 Advanced Micro Devices, Inc. All rights reserved. diff --git a/src/digest/gui_config.yaml b/src/digest/gui_config.yaml index dbd1c08..baffd47 100644 --- a/src/digest/gui_config.yaml +++ b/src/digest/gui_config.yaml @@ -2,4 +2,4 @@ # For EXE releases we can block certain features e.g. to customers modules: - huggingface: true \ No newline at end of file + huggingface: false \ No newline at end of file diff --git a/src/digest/model_class/digest_report_model.py b/src/digest/model_class/digest_report_model.py index 50e76de..f2ccd26 100644 --- a/src/digest/model_class/digest_report_model.py +++ b/src/digest/model_class/digest_report_model.py @@ -138,12 +138,15 @@ def __init__( def parse_model_nodes(self) -> None: """There are no model nodes to parse""" + return def save_yaml_report(self, filepath: str) -> None: """Report models are not intended to be saved""" + return def save_text_report(self, filepath: str) -> None: """Report models are not intended to be saved""" + return def validate_yaml(report_file_path: str) -> bool: @@ -231,10 +234,6 @@ def compare_dicts( differences = compare_dicts(yaml1, yaml2) if differences: - # print("Differences found:") - # for diff in differences: - # print(f"- {diff}") return False else: - # print("No differences found.") return True diff --git a/src/digest/multi_model_selection_page.py b/src/digest/multi_model_selection_page.py index e9d5c2b..33fd78c 100644 --- a/src/digest/multi_model_selection_page.py +++ b/src/digest/multi_model_selection_page.py @@ -93,7 +93,14 @@ def __init__( self.ui.radioONNX.toggled.connect(self.update_list_view_items) self.ui.radioReports.toggled.connect(self.update_list_view_items) self.ui.selectFolderBtn.clicked.connect(self.openFolder) + + # We want to retain the size when the duplicate label + # is hidden to keep the two list columns even. + policy = self.ui.duplicateLabel.sizePolicy() + policy.setRetainSizeWhenHidden(True) + self.ui.duplicateLabel.setSizePolicy(policy) self.ui.duplicateLabel.hide() + self.ui.modelListView.setModel(self.item_model) self.ui.modelListView.setContextMenuPolicy( Qt.ContextMenuPolicy.CustomContextMenu @@ -324,10 +331,7 @@ def set_directory(self, directory: str): progress.close() if num_duplicates: - label_text = ( - f"The following {num_duplicates} models were found to be " - "duplicates and have been deselected from the list on the left." - ) + label_text = f"Ignoring {num_duplicates} duplicate model(s)." self.ui.duplicateLabel.setText(label_text) self.ui.duplicateLabel.show() else: diff --git a/src/digest/ui/multimodelselection_page.ui b/src/digest/ui/multimodelselection_page.ui index 034ed88..b40d460 100644 --- a/src/digest/ui/multimodelselection_page.ui +++ b/src/digest/ui/multimodelselection_page.ui @@ -218,31 +218,6 @@ - - - - - 0 - 0 - - - - - 550 - 0 - - - - - - - The following models were found to be duplicates and have been deselected from the list on the left. - - - true - - - @@ -258,25 +233,43 @@ - - - - - - - 0 selected models - - - true - - - + + + + + 0 + 0 + + + + + 0 + 10 + + + + + + + 0 selected models + + + true + + + + + + 0 + 0 + + @@ -295,10 +288,38 @@ + + + + true + + + + 0 + 0 + + + + + 0 + 10 + + + + + + + Ignoring 0 duplicate model(s). + + + true + + + - + 0 0 diff --git a/src/digest/ui/multimodelselection_page_ui.py b/src/digest/ui/multimodelselection_page_ui.py index 0e25178..02a3bfc 100644 --- a/src/digest/ui/multimodelselection_page_ui.py +++ b/src/digest/ui/multimodelselection_page_ui.py @@ -135,19 +135,6 @@ def setupUi(self, MultiModelSelection): self.horizontalLayout_3.addWidget(self.radioReports) - self.duplicateLabel = QLabel(MultiModelSelection) - self.duplicateLabel.setObjectName(u"duplicateLabel") - sizePolicy2 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Preferred) - sizePolicy2.setHorizontalStretch(0) - sizePolicy2.setVerticalStretch(0) - sizePolicy2.setHeightForWidth(self.duplicateLabel.sizePolicy().hasHeightForWidth()) - self.duplicateLabel.setSizePolicy(sizePolicy2) - self.duplicateLabel.setMinimumSize(QSize(550, 0)) - self.duplicateLabel.setStyleSheet(u"") - self.duplicateLabel.setWordWrap(True) - - self.horizontalLayout_3.addWidget(self.duplicateLabel) - self.horizontalSpacer_2 = QSpacerItem(40, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum) self.horizontalLayout_3.addItem(self.horizontalSpacer_2) @@ -155,19 +142,30 @@ def setupUi(self, MultiModelSelection): self.verticalLayout.addLayout(self.horizontalLayout_3) + self.columnsLayout = QHBoxLayout() + self.columnsLayout.setObjectName(u"columnsLayout") + self.leftColumnLayout = QVBoxLayout() + self.leftColumnLayout.setObjectName(u"leftColumnLayout") self.numSelectedLabel = QLabel(MultiModelSelection) self.numSelectedLabel.setObjectName(u"numSelectedLabel") + sizePolicy2 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) + sizePolicy2.setHorizontalStretch(0) + sizePolicy2.setVerticalStretch(0) + sizePolicy2.setHeightForWidth(self.numSelectedLabel.sizePolicy().hasHeightForWidth()) + self.numSelectedLabel.setSizePolicy(sizePolicy2) + self.numSelectedLabel.setMinimumSize(QSize(0, 10)) self.numSelectedLabel.setStyleSheet(u"") self.numSelectedLabel.setWordWrap(True) - self.verticalLayout.addWidget(self.numSelectedLabel) + self.leftColumnLayout.addWidget(self.numSelectedLabel) - self.columnsLayout = QHBoxLayout() - self.columnsLayout.setObjectName(u"columnsLayout") - self.leftColumnLayout = QVBoxLayout() - self.leftColumnLayout.setObjectName(u"leftColumnLayout") self.modelListView = QListView(MultiModelSelection) self.modelListView.setObjectName(u"modelListView") + sizePolicy3 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred) + sizePolicy3.setHorizontalStretch(0) + sizePolicy3.setVerticalStretch(0) + sizePolicy3.setHeightForWidth(self.modelListView.sizePolicy().hasHeightForWidth()) + self.modelListView.setSizePolicy(sizePolicy3) self.modelListView.setStyleSheet(u"") self.modelListView.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers) self.modelListView.setSelectionMode(QAbstractItemView.SelectionMode.MultiSelection) @@ -180,13 +178,24 @@ def setupUi(self, MultiModelSelection): self.rightColumnLayout = QVBoxLayout() self.rightColumnLayout.setObjectName(u"rightColumnLayout") + self.duplicateLabel = QLabel(MultiModelSelection) + self.duplicateLabel.setObjectName(u"duplicateLabel") + self.duplicateLabel.setEnabled(True) + sizePolicy2.setHeightForWidth(self.duplicateLabel.sizePolicy().hasHeightForWidth()) + self.duplicateLabel.setSizePolicy(sizePolicy2) + self.duplicateLabel.setMinimumSize(QSize(0, 10)) + self.duplicateLabel.setStyleSheet(u"") + self.duplicateLabel.setWordWrap(True) + + self.rightColumnLayout.addWidget(self.duplicateLabel) + self.duplicateListWidget = QListWidget(MultiModelSelection) self.duplicateListWidget.setObjectName(u"duplicateListWidget") - sizePolicy3 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding) - sizePolicy3.setHorizontalStretch(0) - sizePolicy3.setVerticalStretch(0) - sizePolicy3.setHeightForWidth(self.duplicateListWidget.sizePolicy().hasHeightForWidth()) - self.duplicateListWidget.setSizePolicy(sizePolicy3) + sizePolicy4 = QSizePolicy(QSizePolicy.Policy.MinimumExpanding, QSizePolicy.Policy.Expanding) + sizePolicy4.setHorizontalStretch(0) + sizePolicy4.setVerticalStretch(0) + sizePolicy4.setHeightForWidth(self.duplicateListWidget.sizePolicy().hasHeightForWidth()) + self.duplicateListWidget.setSizePolicy(sizePolicy4) self.duplicateListWidget.setStyleSheet(u"") self.duplicateListWidget.setEditTriggers(QAbstractItemView.EditTrigger.NoEditTriggers) self.duplicateListWidget.setSelectionMode(QAbstractItemView.SelectionMode.MultiSelection) @@ -219,7 +228,7 @@ def retranslateUi(self, MultiModelSelection): self.radioAll.setText(QCoreApplication.translate("MultiModelSelection", u"All", None)) self.radioONNX.setText(QCoreApplication.translate("MultiModelSelection", u"ONNX", None)) self.radioReports.setText(QCoreApplication.translate("MultiModelSelection", u"Reports", None)) - self.duplicateLabel.setText(QCoreApplication.translate("MultiModelSelection", u"The following models were found to be duplicates and have been deselected from the list on the left.", None)) self.numSelectedLabel.setText(QCoreApplication.translate("MultiModelSelection", u"0 selected models", None)) + self.duplicateLabel.setText(QCoreApplication.translate("MultiModelSelection", u"Ignoring 0 duplicate model(s).", None)) # retranslateUi diff --git a/test/resnet18_reports/resnet18_report.txt b/test/resnet18_reports/resnet18_report.txt index fdda0bf..d68027e 100644 --- a/test/resnet18_reports/resnet18_report.txt +++ b/test/resnet18_reports/resnet18_report.txt @@ -1,5 +1,5 @@ Report created on December 06, 2024 -ONNX file: C:\Users\pcolange\Projects\digestai\test\resnet18.onnx +ONNX file: test\resnet18.onnx Name of the model: resnet18 Model version: 0 Name of the graph: main_graph diff --git a/test/resnet18_reports/resnet18_report.yaml b/test/resnet18_reports/resnet18_report.yaml index 9df22be..9839302 100644 --- a/test/resnet18_reports/resnet18_report.yaml +++ b/test/resnet18_reports/resnet18_report.yaml @@ -1,5 +1,5 @@ report_date: December 06, 2024 -model_file: C:\Users\pcolange\Projects\digestai\test\resnet18.onnx +model_file: test\resnet18.onnx model_type: onnx model_name: resnet18 model_version: 0