diff --git a/.gitignore b/.gitignore index ad39306..ceda881 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ __pycache__/ /tmp/ /.cache/ /output/ +.DS_Store diff --git a/README.md b/README.md index c1f6498..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,33 +0,0 @@ -# 20220901 项目:异常值检测可视化 - -纪要: -1. 可视化形式要多样,多种图形; -2. 后台的代码找现成的Python代码,确保有几个基于聚类的方法; -3. 前端基于pyqt; - -https://github.com/yzhao062/pyod - -https://pyod.readthedocs.io/en/latest/example.html - -生成仿真数据 - -https://pyod.readthedocs.io/en/latest/pyod.utils.html#pyod.utils.data.generate_data - -所有模型 - -https://pyod.readthedocs.io/en/latest/pyod.models.html - - -模型列表 -``` -'ABOD', -'AutoEncoder', -'CBLOF', -'HBOS', -'IForest', -'KNN', -'LOF', -'MCD', -'OCSVM', -'PCA' -``` diff --git a/app.py b/app.py index 3597a53..b129b5d 100644 --- a/app.py +++ b/app.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from Application import MyWindow, QtWidgets +from src.Application import MyWindow, QtWidgets if __name__ == "__main__": import sys diff --git a/desk.drawio b/draw/desk.drawio similarity index 100% rename from desk.drawio rename to draw/desk.drawio diff --git a/desk.ico b/draw/desk.ico similarity index 100% rename from desk.ico rename to draw/desk.ico diff --git a/desk.png b/draw/desk.png similarity index 100% rename from desk.png rename to draw/desk.png diff --git a/splash.drawio b/draw/splash.drawio similarity index 100% rename from splash.drawio rename to draw/splash.drawio diff --git a/splash.png b/draw/splash.png similarity index 100% rename from splash.png rename to draw/splash.png diff --git a/scripts/compile-res.cmd b/scripts/compile-res.cmd deleted file mode 100644 index bb01ad9..0000000 --- a/scripts/compile-res.cmd +++ /dev/null @@ -1 +0,0 @@ -pyrcc5 .\res.qrc -o res_rc.py \ No newline at end of file diff --git a/scripts/compile-ui.cmd b/scripts/compile-ui.cmd deleted file mode 100644 index 8f81058..0000000 --- a/scripts/compile-ui.cmd +++ /dev/null @@ -1 +0,0 @@ -pyuic5.exe -x -o UserInterface.py UserInterface.ui diff --git a/scripts/designer.cmd b/scripts/designer.cmd deleted file mode 100644 index 9f2db85..0000000 --- a/scripts/designer.cmd +++ /dev/null @@ -1 +0,0 @@ -pyqt5-tools.exe designer ./UserInterface.ui diff --git a/scripts/package-exe.cmd b/scripts/package-exe.cmd deleted file mode 100644 index 3d1bda6..0000000 --- a/scripts/package-exe.cmd +++ /dev/null @@ -1,2 +0,0 @@ -python scripts/convert-ico.py ./desk.png -pyinstaller ./Application.py --name OutlierDetect -w --noconfirm -i desk.ico diff --git a/scripts/setup-env.cmd b/scripts/setup-env.cmd deleted file mode 100644 index 0d90304..0000000 --- a/scripts/setup-env.cmd +++ /dev/null @@ -1,3 +0,0 @@ -pip3 install -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r ./requirements.txt -pyqt5-tools.exe installuic -./scripts/compile-ui.cmd diff --git a/scripts/start-ui.cmd b/scripts/start-ui.cmd deleted file mode 100644 index 8d4f512..0000000 --- a/scripts/start-ui.cmd +++ /dev/null @@ -1,2 +0,0 @@ -scripts\compile-ui.cmd -python.exe .\Application.py diff --git a/scripts/update-pip.cmd b/scripts/update-pip.cmd deleted file mode 100644 index 5846804..0000000 --- a/scripts/update-pip.cmd +++ /dev/null @@ -1,2 +0,0 @@ - -python -m pip install --upgrade pip diff --git a/Application.py b/src/Application.py similarity index 98% rename from Application.py rename to src/Application.py index cc88898..565b5e9 100644 --- a/Application.py +++ b/src/Application.py @@ -26,7 +26,7 @@ import traceback from typing import Callable, Dict -from UserInterface import * +from src.UserInterface import * from PyQt5.QtWidgets import * from PyQt5.QtCore import pyqtSlot, pyqtSignal, QThread from PyQt5.QtWidgets import ( @@ -39,7 +39,7 @@ QCheckBox, ) from PyQt5.QtGui import QIntValidator, QDoubleValidator -from OutlierDetect import MODEL_ZOO, DataConfig, DetectionEvaluator, ModelConfig +from src.OutlierDetect import MODEL_ZOO, DataConfig, DetectionEvaluator, ModelConfig import logging logging.basicConfig(level=logging.INFO) @@ -64,7 +64,7 @@ def __init__(self): self.ui.cbModelName.addItems(MODEL_ZOO.model_list) self.ui.cbModelName.setCurrentText('KNN') - from NAME import NAME + from src.NAME import NAME self.ui.centralwidget.setWindowTitle(NAME) self.ui.leNumTrain.setText(str(self.data_config.n_train)) diff --git a/Batch.py b/src/Batch.py similarity index 98% rename from Batch.py rename to src/Batch.py index 507a349..89830ff 100644 --- a/Batch.py +++ b/src/Batch.py @@ -25,7 +25,7 @@ """ from pathlib import Path as P -from OutlierDetect import * +from src.OutlierDetect import * OUTPUT_DIR = ensure_dir(PROJ_DIR.joinpath('output')) diff --git a/NAME.py b/src/NAME.py similarity index 100% rename from NAME.py rename to src/NAME.py diff --git a/OutlierDetect.py b/src/OutlierDetect.py similarity index 99% rename from OutlierDetect.py rename to src/OutlierDetect.py index 4643c4b..a555bb5 100644 --- a/OutlierDetect.py +++ b/src/OutlierDetect.py @@ -61,7 +61,7 @@ def ensure_dir(dir: P): EAGER = os.getenv('ODQT_EAGER', '') if EAGER: LOG.info('EAGER loading pyod modules...') - import PYODLIBS + import src.PYODLIBS as PYODLIBS LOG.info('Done') else: PYODLIBS = None diff --git a/PYODLIBS.py b/src/PYODLIBS.py similarity index 100% rename from PYODLIBS.py rename to src/PYODLIBS.py diff --git a/UserInterface.py b/src/UserInterface.py similarity index 99% rename from UserInterface.py rename to src/UserInterface.py index c579458..acd454d 100644 --- a/UserInterface.py +++ b/src/UserInterface.py @@ -1513,7 +1513,7 @@ def retranslateUi(self, MainWindow): self.label_6.setText(_translate("MainWindow", "随机种子")) self.groupBox.setTitle(_translate("MainWindow", "检测结果")) self.pbRunDetect.setText(_translate("MainWindow", "检测")) -import res_rc +import src.res_rc as res_rc if __name__ == "__main__": diff --git a/UserInterface.ui b/src/UserInterface.ui similarity index 100% rename from UserInterface.ui rename to src/UserInterface.ui diff --git a/res.qrc b/src/res.qrc similarity index 100% rename from res.qrc rename to src/res.qrc diff --git a/res_rc.py b/src/res_rc.py similarity index 100% rename from res_rc.py rename to src/res_rc.py diff --git a/add-lic.py b/tools/add-lic.py similarity index 100% rename from add-lic.py rename to tools/add-lic.py diff --git a/compile-ui.py b/tools/compile-ui.py similarity index 100% rename from compile-ui.py rename to tools/compile-ui.py diff --git a/scripts/convert-ico.py b/tools/convert-ico.py similarity index 100% rename from scripts/convert-ico.py rename to tools/convert-ico.py diff --git a/designer.py b/tools/designer.py similarity index 100% rename from designer.py rename to tools/designer.py diff --git a/package-exe.py b/tools/package-exe.py similarity index 98% rename from package-exe.py rename to tools/package-exe.py index 7381d15..717728a 100644 --- a/package-exe.py +++ b/tools/package-exe.py @@ -23,7 +23,7 @@ import os # NAME = '异常流量数据分析软件' -from NAME import NAME +from src.NAME import NAME os.system(f'python scripts/convert-ico.py ./desk.png') os.system( diff --git a/setup-env.py b/tools/setup-env.py similarity index 100% rename from setup-env.py rename to tools/setup-env.py