memolib 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- memolib-1.0.0/MemoLib/Model/BaseModel/IModel.py +25 -0
- memolib-1.0.0/MemoLib/Model/BaseModel/__init__.py +25 -0
- memolib-1.0.0/MemoLib/Model/BaseModel/eAnomalyModel.py +12 -0
- memolib-1.0.0/MemoLib/Model/BaseModel/eClassificationModel.py +52 -0
- memolib-1.0.0/MemoLib/Model/BaseModel/eDetectionModel.py +34 -0
- memolib-1.0.0/MemoLib/Model/BaseModel/eModelBase.py +31 -0
- memolib-1.0.0/MemoLib/Model/BaseModel/eRecognitionModel.py +0 -0
- memolib-1.0.0/MemoLib/Model/BaseModel/eSegmentationModel.py +36 -0
- memolib-1.0.0/MemoLib/Model/DinoUperNet/DinoUperNet.py +1035 -0
- memolib-1.0.0/MemoLib/Model/DinoUperNet/DinoUperNetConfig.py +163 -0
- memolib-1.0.0/MemoLib/Model/DinoUperNet/__init__.py +4 -0
- memolib-1.0.0/MemoLib/Model/Efficientnet/EfficientNetConfig.py +121 -0
- memolib-1.0.0/MemoLib/Model/Efficientnet/EfficientNetModel.py +724 -0
- memolib-1.0.0/MemoLib/Model/Efficientnet/__init__.py +4 -0
- memolib-1.0.0/MemoLib/Model/PPLCNet/PPLCNetConfig.py +111 -0
- memolib-1.0.0/MemoLib/Model/PPLCNet/PPLCNetModel.py +694 -0
- memolib-1.0.0/MemoLib/Model/PPLCNet/__init__.py +4 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/SVTRV2Common.py +120 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/SVTRV2Config.py +106 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/SVTRV2Decoder.py +503 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/SVTRV2Encoder.py +516 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/SVTRV2LabelEncode.py +226 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/SVTRV2Loss.py +64 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/SVTRV2Model.py +824 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/SVTRV2Transform.py +347 -0
- memolib-1.0.0/MemoLib/Model/STVRV2/__init__.py +17 -0
- memolib-1.0.0/MemoLib/Model/YOLO/YoloConfig.py +154 -0
- memolib-1.0.0/MemoLib/Model/YOLO/YoloModel.py +439 -0
- memolib-1.0.0/MemoLib/Model/YOLO/__init__.py +4 -0
- memolib-1.0.0/MemoLib/Model/__init__.py +19 -0
- memolib-1.0.0/MemoLib/Pretrain/svtrv2_smtr_gtc_rctc/EN_symbol_dict.txt +94 -0
- memolib-1.0.0/MemoLib/__init__.py +49 -0
- memolib-1.0.0/PKG-INFO +166 -0
- memolib-1.0.0/README.md +125 -0
- memolib-1.0.0/memolib.egg-info/PKG-INFO +166 -0
- memolib-1.0.0/memolib.egg-info/SOURCES.txt +39 -0
- memolib-1.0.0/memolib.egg-info/dependency_links.txt +1 -0
- memolib-1.0.0/memolib.egg-info/requires.txt +24 -0
- memolib-1.0.0/memolib.egg-info/top_level.txt +1 -0
- memolib-1.0.0/pyproject.toml +55 -0
- memolib-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from .eModelBase import eModelExportType
|
|
3
|
+
|
|
4
|
+
class IModel(ABC):
|
|
5
|
+
@abstractmethod
|
|
6
|
+
def LoadWeight(self, weightPath: str): pass
|
|
7
|
+
|
|
8
|
+
@abstractmethod
|
|
9
|
+
def Predict(self, img): pass
|
|
10
|
+
|
|
11
|
+
@abstractmethod
|
|
12
|
+
def BatchPredict(self, batchImg): pass
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def Train(self): pass
|
|
16
|
+
|
|
17
|
+
@abstractmethod
|
|
18
|
+
def StopTraining(self): pass
|
|
19
|
+
|
|
20
|
+
@abstractmethod
|
|
21
|
+
def Export(self, pathToPytorchModel: str, exportType: eModelExportType): pass
|
|
22
|
+
|
|
23
|
+
@abstractmethod
|
|
24
|
+
def StopTraining(self): pass
|
|
25
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from .IModel import IModel
|
|
2
|
+
from .eModelBase import eModelType, eDetectionModelType, eSegmentationModelType
|
|
3
|
+
from .eModelBase import eClassificationModelType, eRecognitionModelType
|
|
4
|
+
from .eModelBase import eAnomalyDetectionModelType
|
|
5
|
+
from .eModelBase import eModelExportType, eOptimizerType
|
|
6
|
+
from .eDetectionModel import eYoloDetectionModel, eRFDetrDetectionModel
|
|
7
|
+
from .eSegmentationModel import eYoloSegmentationModel
|
|
8
|
+
from .eClassificationModel import (
|
|
9
|
+
eYoloClassificationModel, eRFDetrClassificationModel
|
|
10
|
+
)
|
|
11
|
+
from .eClassificationModel import eEfficientNetModel, ePPLCNetModel
|
|
12
|
+
from .eAnomalyModel import eDinomalyModel, eINPFormerlyModel
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
'IModel',
|
|
16
|
+
'eModelType', 'eDetectionModelType', 'eSegmentationModelType',
|
|
17
|
+
'eClassificationModelType', 'eRecognitionModelType',
|
|
18
|
+
'eAnomalyDetectionModelType',
|
|
19
|
+
'eModelExportType', 'eOptimizerType',
|
|
20
|
+
'eYoloDetectionModel', 'eRFDetrDetectionModel',
|
|
21
|
+
'eYoloSegmentationModel',
|
|
22
|
+
'eYoloClassificationModel', 'eRFDetrClassificationModel',
|
|
23
|
+
'eEfficientNetModel', 'ePPLCNetModel',
|
|
24
|
+
'eDinomalyModel', 'eINPFormerlyModel',
|
|
25
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from MemoLib.Model.BaseModel.eModelBase import eAnomalyDetectionModelType
|
|
2
|
+
|
|
3
|
+
class eDinomalyModel(eAnomalyDetectionModelType):
|
|
4
|
+
Dinomaly_S = 0
|
|
5
|
+
Dinomaly_B = 1
|
|
6
|
+
Dinomaly_L = 2
|
|
7
|
+
|
|
8
|
+
class eINPFormerlyModel(eAnomalyDetectionModelType):
|
|
9
|
+
INFormerly_S = 0
|
|
10
|
+
INFormerly_B = 1
|
|
11
|
+
INFormerly_L = 2
|
|
12
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from MemoLib.Model.BaseModel.eModelBase import eClassificationModelType
|
|
2
|
+
|
|
3
|
+
class eYoloClassificationModel(eClassificationModelType):
|
|
4
|
+
YoloV5n = 0
|
|
5
|
+
YoloV5s = 1
|
|
6
|
+
YoloV5m = 2
|
|
7
|
+
YoloV5l = 3
|
|
8
|
+
YoloV5x = 4
|
|
9
|
+
YoloV8n = 5
|
|
10
|
+
YoloV8s = 6
|
|
11
|
+
YoloV8m = 7
|
|
12
|
+
YoloV8l = 8
|
|
13
|
+
YoloV8x = 9
|
|
14
|
+
Yolo11n = 10
|
|
15
|
+
Yolo11s = 11
|
|
16
|
+
Yolo11m = 12
|
|
17
|
+
Yolo11l = 13
|
|
18
|
+
Yolo11x = 14
|
|
19
|
+
Yolo26n = 15
|
|
20
|
+
Yolo26s = 16
|
|
21
|
+
Yolo26m = 17
|
|
22
|
+
Yolo26l = 18
|
|
23
|
+
Yolo26x = 19
|
|
24
|
+
|
|
25
|
+
class eRFDetrClassificationModel(eClassificationModelType):
|
|
26
|
+
RFDETRNano = 0
|
|
27
|
+
RFDETRSmall = 1
|
|
28
|
+
RFDETRMedium = 2
|
|
29
|
+
RFDETRLarge = 3
|
|
30
|
+
RFDETRXLarge = 4
|
|
31
|
+
RFDETR2XLarge = 5
|
|
32
|
+
|
|
33
|
+
class eEfficientNetModel(eClassificationModelType):
|
|
34
|
+
B0 = 0
|
|
35
|
+
B1 = 1
|
|
36
|
+
B2 = 2
|
|
37
|
+
B3 = 3
|
|
38
|
+
B4 = 4
|
|
39
|
+
B5 = 5
|
|
40
|
+
B6 = 6
|
|
41
|
+
B7 = 7
|
|
42
|
+
V2S = 8
|
|
43
|
+
V2M = 9
|
|
44
|
+
V2L = 10
|
|
45
|
+
V2XL = 11
|
|
46
|
+
|
|
47
|
+
class ePPLCNetModel(eClassificationModelType):
|
|
48
|
+
PPLCNetx25 = 0
|
|
49
|
+
PPLCNetx35 = 1
|
|
50
|
+
PPLCNetx50 = 2
|
|
51
|
+
PPLCNetx75 = 3
|
|
52
|
+
PPLCNetx100 = 4
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
from MemoLib.Model.BaseModel.eModelBase import eDetectionModelType
|
|
3
|
+
|
|
4
|
+
class eYoloDetectionModel(eDetectionModelType):
|
|
5
|
+
YoloV5n = 0
|
|
6
|
+
YoloV5s = 1
|
|
7
|
+
YoloV5m = 2
|
|
8
|
+
YoloV5l = 3
|
|
9
|
+
YoloV5x = 4
|
|
10
|
+
YoloV8n = 5
|
|
11
|
+
YoloV8s = 6
|
|
12
|
+
YoloV8m = 7
|
|
13
|
+
YoloV8l = 8
|
|
14
|
+
YoloV8x = 9
|
|
15
|
+
Yolo11n = 10
|
|
16
|
+
Yolo11s = 11
|
|
17
|
+
Yolo11m = 12
|
|
18
|
+
Yolo11l = 13
|
|
19
|
+
Yolo11x = 14
|
|
20
|
+
Yolo26n = 15
|
|
21
|
+
Yolo26s = 16
|
|
22
|
+
Yolo26m = 17
|
|
23
|
+
Yolo26l = 18
|
|
24
|
+
Yolo26x = 19
|
|
25
|
+
|
|
26
|
+
class eRFDetrDetectionModel(eDetectionModelType):
|
|
27
|
+
RFDETRNano = 0
|
|
28
|
+
RFDETRSmall = 1
|
|
29
|
+
RFDETRMedium = 2
|
|
30
|
+
RFDETRLarge = 3
|
|
31
|
+
RFDETRXLarge = 4
|
|
32
|
+
RFDETR2XLarge = 5
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
class eModelType(Enum):
|
|
4
|
+
pass
|
|
5
|
+
|
|
6
|
+
class eDetectionModelType(eModelType):
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
class eSegmentationModelType(eModelType):
|
|
10
|
+
pass
|
|
11
|
+
|
|
12
|
+
class eClassificationModelType(eModelType):
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
class eRecognitionModelType(eModelType):
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
class eAnomalyDetectionModelType(eModelType):
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
class eModelExportType(Enum):
|
|
22
|
+
ONNX = 0
|
|
23
|
+
OpenVINO = 1
|
|
24
|
+
TensorRT = 2
|
|
25
|
+
|
|
26
|
+
class eOptimizerType(Enum):
|
|
27
|
+
SGD = 0
|
|
28
|
+
Adam = 1
|
|
29
|
+
AdamW = 2
|
|
30
|
+
RMSprop = 3
|
|
31
|
+
Adagrad = 4
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from .eModelBase import eSegmentationModelType
|
|
2
|
+
|
|
3
|
+
class eYoloSegmentationModel(eSegmentationModelType):
|
|
4
|
+
YoloV5n = 0
|
|
5
|
+
YoloV5s = 1
|
|
6
|
+
YoloV5m = 2
|
|
7
|
+
YoloV5l = 3
|
|
8
|
+
YoloV5x = 4
|
|
9
|
+
YoloV8n = 5
|
|
10
|
+
YoloV8s = 6
|
|
11
|
+
YoloV8m = 7
|
|
12
|
+
YoloV8l = 8
|
|
13
|
+
YoloV8x = 9
|
|
14
|
+
Yolo11n = 10
|
|
15
|
+
Yolo11s = 11
|
|
16
|
+
Yolo11m = 12
|
|
17
|
+
Yolo11l = 13
|
|
18
|
+
Yolo11x = 14
|
|
19
|
+
Yolo26n = 15
|
|
20
|
+
Yolo26s = 16
|
|
21
|
+
Yolo26m = 17
|
|
22
|
+
Yolo26l = 18
|
|
23
|
+
Yolo26x = 19
|
|
24
|
+
|
|
25
|
+
class eDinoUperNetModel(eSegmentationModelType):
|
|
26
|
+
DINO_S = 0
|
|
27
|
+
DINO_B = 1
|
|
28
|
+
DINO_L = 2
|
|
29
|
+
|
|
30
|
+
class eRFDetrSegmentationModel(eSegmentationModelType):
|
|
31
|
+
RFDETRNano = 0
|
|
32
|
+
RFDETRSmall = 1
|
|
33
|
+
RFDETRMedium = 2
|
|
34
|
+
RFDETRLarge = 3
|
|
35
|
+
RFDETRXLarge = 4
|
|
36
|
+
RFDETR2XLarge = 5
|