A deep learning library for computer vision tasks (CUDA ≥11.8 compatible)
Project description
DeepLib
A unified PyTorch library for computer vision tasks, focusing on object detection, semantic segmentation, and anomaly detection.
Installation
Prerequisites
DeepLib requires PyTorch and torchvision to be installed first. For optimal performance, CUDA 11.8 or above is recommended.
You can install PyTorch with CUDA support using:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
For other installation options (CPU-only, different CUDA versions), see the PyTorch installation guide.
Installing DeepLib
Full Installation
Install DeepLib with all optional dependencies (recommended):
pip install deeplib
Core Installation
Install only the core functionality (no logging backends):
pip install deeplib[core]
Documentation
Full documentation is available at https://jonleinena.github.io/deeplib/
Features
-
Semantic Segmentation Models (✅ Implemented)
- UNet
- DeepLabV3
- DeepLabV3+
-
Experiment Tracking (✅ Implemented)
- TensorBoard
- MLflow
- Weights & Biases (W&B)
-
Object Detection Models (🚧 In Progress)
- YOLOv4
- YOLOv5
- YOLOX
- YOLOv7 and YOLOv9
- Faster R-CNN
-
Anomaly Detection Models (🚧 In Progress)
- PatchCore
- FastFlow
- PADIM
- Other anomalib implementations
Quick Start - Semantic Segmentation
from deeplib.models.segmentation import UNet
from deeplib.trainers import SegmentationTrainer
from deeplib.datasets import SegmentationDataset
from deeplib.loggers import WandbLogger # or TensorBoardLogger, MLFlowLogger
from torch.utils.data import DataLoader
# Initialize model
model = UNet(num_classes=4)
# Prepare dataset
train_dataset = SegmentationDataset(
root="path/to/data",
images_dir="images",
masks_dir="masks",
num_classes=4,
split="train"
)
val_dataset = SegmentationDataset(
root="path/to/data",
images_dir="images",
masks_dir="masks",
num_classes=4,
split="val"
)
# Create dataloaders
train_loader = DataLoader(train_dataset, batch_size=8, shuffle=True)
val_loader = DataLoader(val_dataset, batch_size=8)
# Configure loss function (e.g., Dice Loss)
model.configure_loss('dice', {'ignore_index': 255})
# Initialize logger (choose one)
logger = WandbLogger(
experiment_name="segmentation_experiment",
project="deeplib-segmentation"
)
# Or use TensorBoard:
# logger = TensorBoardLogger(experiment_name="segmentation_experiment")
# Or use MLflow:
# logger = MLFlowLogger(experiment_name="segmentation_experiment")
# Initialize trainer with logger
trainer = SegmentationTrainer(
model=model,
train_loader=train_loader,
val_loader=val_loader,
monitor_metric='iou', # Monitor IoU for LR scheduling
logger=logger
)
# Train model
trainer.train(
num_epochs=100,
save_path='best_model.pth'
)
For more examples and detailed usage, check the examples directory.
Project Structure
deeplib/
├── models/
│ ├── segmentation/ # ✅ Semantic segmentation models
│ ├── detection/ # 🚧 Object detection models (TODO)
│ └── anomaly/ # 🚧 Anomaly detection models (TODO)
├── trainers/ # Training logic and utilities
├── datasets/ # Dataset implementations
├── loggers/ # ✅ Experiment tracking (TensorBoard, MLflow, W&B)
└── utils/ # Utility functions
Development Roadmap
High Priority
- Implement experiment tracking
- TensorBoard support
- MLflow support
- W&B support
- Add comprehensive documentation
- API Reference
- Examples
- Installation Guide
- Implement object detection models
- YOLOv4
- YOLOv5
- Faster R-CNN
- Add anomaly detection support
- PatchCore
- FastFlow
- PADIM
- Add data augmentation pipeline
- Add model export (ONNX, TorchScript)
Medium Priority
- Add more segmentation models
- FPN
- SegFormer
- BEiT
- Add test suite
- Add model benchmarks
- Add visualization tools
Low Priority
- Add multi-GPU training support
- Add quantization support
- Add model pruning
- Add hyperparameter tuning
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
This library is inspired by the following projects:
- torchvision
- anomalib
- segmentation-models-pytorch
- YOLOMIT
Installation Options
Full Installation (Recommended)
pip install deeplib
Core Installation (without logging backends)
pip install deeplib[core]
CUDA Requirements
This package requires PyTorch with CUDA 11.8 or newer. To install PyTorch dependencies:
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
For other CUDA versions or CPU-only installation, see https://pytorch.org/get-started/locally/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deeplib-1.1.0.tar.gz.
File metadata
- Download URL: deeplib-1.1.0.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb53d98749dcf2ddf2f4631c52121df87a74c091f2c75efa26960ed7a85b7ff6
|
|
| MD5 |
73d56839929db6910c9a8fdc39a398d6
|
|
| BLAKE2b-256 |
345bd8e02041233bcf9865e9df3e5b3e72c0d5c0ff3e0847ffbe4aa406e41e0c
|
Provenance
The following attestation bundles were made for deeplib-1.1.0.tar.gz:
Publisher:
publish.yml on jonleinena/deeplib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deeplib-1.1.0.tar.gz -
Subject digest:
bb53d98749dcf2ddf2f4631c52121df87a74c091f2c75efa26960ed7a85b7ff6 - Sigstore transparency entry: 156327579
- Sigstore integration time:
-
Permalink:
jonleinena/deeplib@81776a4a071caac2f1bc1ef22972e638c4aba367 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/jonleinena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@81776a4a071caac2f1bc1ef22972e638c4aba367 -
Trigger Event:
release
-
Statement type:
File details
Details for the file deeplib-1.1.0-py3-none-any.whl.
File metadata
- Download URL: deeplib-1.1.0-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2b5a259088351e7e56b35ba5185946bbec24b29ec32209cc1873939c58024e2
|
|
| MD5 |
a04376115d10e5618df312dd1a136ab3
|
|
| BLAKE2b-256 |
15e1ff029507c4aa7a826e3137cdf9940b4c50a524415952e5e0824d8948e0c9
|
Provenance
The following attestation bundles were made for deeplib-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on jonleinena/deeplib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deeplib-1.1.0-py3-none-any.whl -
Subject digest:
a2b5a259088351e7e56b35ba5185946bbec24b29ec32209cc1873939c58024e2 - Sigstore transparency entry: 156327580
- Sigstore integration time:
-
Permalink:
jonleinena/deeplib@81776a4a071caac2f1bc1ef22972e638c4aba367 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/jonleinena
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@81776a4a071caac2f1bc1ef22972e638c4aba367 -
Trigger Event:
release
-
Statement type: