MemoLib
A computer vision model library built on PyTorch, providing a unified interface for object detection, image segmentation, image classification, text recognition, and anomaly detection.
Model Status
| Category | Model | Status |
|---|---|---|
| Detection | YOLOv5, YOLOv8, YOLO11, YOLO26 | Stable |
| Detection | RF-DETR | Stable |
| Segmentation | YOLO Segment (v8, 11, 26) | Stable |
| Segmentation | DINO UperNet | Stable |
| Classification | PPLCNet (x0.25 – x1.0) | Stable |
| Classification | YOLO Classification (v8, 11, 26) | Stable |
| Classification | EfficientNet (B0–B7, V2S/M/L/XL) | Stable |
| Recognition | SVTR2 | Stable |
| Anomaly Detection | Dinomaly2 | ⚠ Not fully tested |
| Anomaly Detection | INP Former | 🔧 Ongoing |
Unified Interface
All models share a consistent API:
model.LoadWeight(path) # Load pretrained or custom weights
model.Train(callbacks) # Start training
model.Predict(image) # Single inference
model.BatchPredict(images) # Batch inference
model.Export(path, format) # Export to ONNX / OpenVINO / TensorRT
model.StopTraining() # Stop training gracefully
Installation
pip install memolib
Optional dependencies
# For YOLO models
pip install memolib[yolo]
# For PPLCNet models
pip install memolib[pplcnet]
# For development
pip install memolib[dev]
Quick Start
Object Detection — YOLO
from MemoLib.Model.YOLO import Yolo
from MemoLib.Model.BaseModel.eDetectionModel import eYoloDetectionModel
model = Yolo()
model.cfg.Architecture = eYoloDetectionModel.Yolo11n
model.cfg.DatasetPath = "path/to/dataset"
model.Train(callbacks=lambda level, msg: print(f"[{level}] {msg}"))
Classification — PPLCNet
from MemoLib.Model.PPLCNet import PPLCNet
from MemoLib.Model.BaseModel.eClassificationModel import ePPLCNetModel
model = PPLCNet()
model.cfg.Architecture = ePPLCNetModel.PPLCNetx50
model.cfg.DatasetPath = "path/to/dataset"
model.Train()
Model Export
from MemoLib.Model.BaseModel.eModelBase import eModelExportType
model.Export("weights/best.pt", eModelExportType.ONNX)
model.Export("weights/best.pt", eModelExportType.OpenVINO)
model.Export("weights/best.pt", eModelExportType.TensorRT)
Project Structure
MemoLib/
└── Model/
├── BaseModel/ # Abstract interface (IModel), enums, export types
├── YOLO/ # YOLO detection, segmentation, classification
├── RFDETR/ # RF-DETR detection
├── DinoUperNet/ # DINO + UperNet semantic segmentation
├── Efficientnet/ # EfficientNet classification
├── PPLCNet/ # PPLCNet lightweight classification
├── SVTRV2/ # SVTR2 text recognition
└── Anomaly/ # Dinomaly2, INP Former
Dataset Format
Classification — YOLO / EfficientNet / PPLCNet
ImageFolder structure (same as torchvision ImageFolder):
dataset/
├── train/
│ ├── cat/
│ │ ├── img001.jpg
│ │ └── img002.jpg
│ └── dog/
│ ├── img003.jpg
│ └── img004.jpg
└── val/
├── cat/
└── dog/
Detection — YOLO (detect / segment)
YOLO label format. data.yaml is auto-generated if missing.
dataset/
├── train/
│ ├── images/
│ │ ├── img001.jpg
│ └── labels/
│ ├── img001.txt # <class> <x_c> <y_c> <w> <h> (normalized 0-1)
├── val/
│ ├── images/
│ └── labels/
└── data.yaml
data.yaml:
path: /path/to/dataset
nc: 2
names: [cat, dog]
train: train/images
val: val/images
For segmentation, the label format uses polygon points:
# <class> <x1> <y1> <x2> <y2> ... <xn> <yn> (normalized 0-1)
0 0.1 0.2 0.3 0.4 0.5 0.6
Detection — RF-DETR
Supports two formats. Auto-detected from directory structure.
COCO format (recommended — exported directly from Roboflow/CVAT):
dataset/
├── train/
│ ├── img001.jpg
│ └── _annotations.coco.json
└── val/
├── img002.jpg
└── _annotations.coco.json
YOLO format (same structure as YOLO detection above):
dataset/
├── train/
│ ├── images/
│ └── labels/
├── val/
│ ├── images/
│ └── labels/
└── data.yaml
Semantic Segmentation — DinoUperNet
Mask images must be single-channel PNG where each pixel value = class index.
dataset/
├── train/
│ ├── images/
│ │ ├── img001.jpg
│ └── masks/
│ ├── img001.png # pixel value = class index (0, 1, 2, ...)
├── val/
│ ├── images/
│ └── masks/
ReduceZeroLabel: if
True, pixel value0is treated as background/unlabeled (ignored in loss), and class indices shift by -1. Use this for datasets like ADE20K where class 0 = unlabeled.
Requirements
- Python 3.9+
- PyTorch 2.x (CUDA 12.x recommended)
- See
requirements.txtfor full dependency list
License
MIT License
Metadata
Release files for memolib 1.10.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| memolib-1.10.4.tar.gz | 985.0 kB | Without provenance | Details for memolib-1.10.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| memolib-1.10.4-py3-none-any.whl | Python 3 | none | any | Details for memolib-1.10.4-py3-none-any.whl |
Total release size: 2.3 MB
Release files / memolib-1.10.4.tar.gz
| Download URL | memolib-1.10.4.tar.gz |
|---|---|
| Size | 985.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7e0c5abd8c8d4ac733ef89a78a1632f7cdb6899405f5078a4b63ac78d3729661
|
|
BLAKE2b-256 checksum How to use checksums |
23b9355aa3e9569658ef56cfad9694ae369e8ce3831fc63ed7a89d3fa84e17dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / memolib-1.10.4-py3-none-any.whl
| Download URL | memolib-1.10.4-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f61d8c9f1bf158f77670f8772b4ef683b4383c66da8fc88026dbb01fe91c34a
|
|
BLAKE2b-256 checksum How to use checksums |
3a8581b5c3b5a1601f635f15b2de2e0b695828b04ad2b62d6ec39422b77e483d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for memolib 1.10.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.