A comprehensive computer vision framework for easy model training and deployment
A powerful, user-friendly open-source computer vision framework that simplifies the process of training and deploying state-of-the-art neural network models for various computer vision tasks.
Table of Contents
- Description
- Features
- Installation
- Quick Start
- Usage Examples
- Supported Models
- Tests
- Contributing
- License
- Contact
CVA_NET is an advanced computer vision framework designed to democratize AI by making complex computer vision tasks accessible to developers, researchers, and enthusiasts. Our platform provides a unified interface for training, evaluating, and deploying various neural network architectures with minimal setup and maximum flexibility.
Key advantages:
- Easy Training: Simplified pipeline for training custom models
- Multiple Architectures: Support for CNN, R-CNN, YOLO, Transformers, and more
- Production Ready: Easy model export and deployment
- Extensible: Modular design for custom implementations
- Image Classification: ResNet, EfficientNet, Vision Transformers
- Object Detection: Faster R-CNN, YOLO variants, SSD
- Instance Segmentation: Mask R-CNN, SOLO
- Multi-task Learning: Simultaneous training for multiple objectives
- Transfer Learning: Pre-trained models and fine-tuning capabilities
- Advanced Augmentation: Comprehensive data augmentation pipeline
- Dataset Management: Support for popular datasets (COCO, ImageNet, Pascal VOC)
- Data Loaders: Optimized data loading for performance
- Preprocessing: Built-in normalization and transformation
- Distributed Training: Multi-GPU training support
- Hyperparameter Optimization: Automated tuning capabilities
- Visualization: Real-time training metrics and loss visualization
- Model Checkpointing: Automatic saving and resuming
- Model Export: Export to ONNX, TorchScript, TensorFlow SavedModel
- Inference API: Simple inference interface
- Web Demo: Built-in web interface for model testing
To install the project, make sure you have Python 3.8 or later version
and pip installed on your machine. And then run the following command lines.
git clone https://github.com/cacybernetic/CVA_NET;
cd CVA_NET;
sudo rm -r .git;
git init; # To create a new instance of git repositoryOpen your terminal and run following command lines to add the deadsnakes PPA to your system:
sudo apt update;
sudo apt install software-properties-common -y;
sudo add-apt-repository ppa:deadsnakes/ppa -y
Refresh your package list to include the deadsnakes PPA and then install Python 3.10:
sudo apt update;
sudo apt install python3.10;
python3.10 --versionNOTE: Do not change the default Python version of Ubuntu, as it may break system tools that depend on it.
In first, install the following dependences on your computer.
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-devAnd then, we can run the following command to install pyenv
directly via APT on your computer.
sudo apt install pyenvOr run the following command lines, to clone and install
pyenv from its souce code.
git clone https://github.com/pyenv/pyenv.git ~/.pyenv;
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc;
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc;
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc;
echo 'eval "$(pyenv init -)"' >> ~/.bashrc;
source ~/.bashrc;Now, runing the following command line, we can use pyenv
to install the version of Python what we want to install.
pyenv install 3.10.18; # Here, we install Python 3.10.18.
sudo ln -s $HOME/.pyenv/versions/3.10.18/bin/python3 /usr/local/bin/python3.10sudo apt install cmake python3-venvInstall Cmake and Virtual env;python3 -m venv .venvcreate a virtual env into directory namedenv;source .venv/bin/activateactivate the virtual environment named.venv;make installinstall the requirements of this package;make dev_installorpip install -e .install the package in dev mode in virtual environment;- Run
make testorpytestto execute the unit test scripts located attestsdirectory.
git clone https://github.com/cacybernetic/CVA_NETcd CVA_NETAnd then, delete the hidden directory named .git located at the root
of the directory project.
And then,
- Install python for windows;
- Open your command prompt;
- Run
python -m venv .venvto create a virtual env into directory named.venv; - Run
.venv\Scripts\activateto activate the virtual environment; - Run
pip install -r requirements.txtto install the requirements of this package or project; - Run
pip install -e .install the package in dev mode in virtual environment; pytestrun the unit test scripts located attestsdirectory.
from cva_net import CVATrainer
from cva_net.models import ResNetClassifier
from cva_net.datasets import ImageFolderDataset
# Initialize dataset
dataset = ImageFolderDataset(
data_dir="./data/train",
image_size=(224, 224),
augment=True
)
# Initialize model
model = ResNetClassifier(
num_classes=10,
backbone="resnet50",
pretrained=True
)
# Setup trainer
trainer = CVATrainer(
model=model,
train_dataset=dataset,
epochs=50,
batch_size=32,
learning_rate=0.001
)
# Start training
trainer.train()
# Evaluate model
metrics = trainer.evaluate()
print(f"Validation Accuracy: {metrics['accuracy']:.2f}%")from cva_net import DetectionTrainer
from cva_net.models import FasterRCNN
model = FasterRCNN(
num_classes=80,
backbone="resnet50",
pretrained_backbone=True
)
trainer = DetectionTrainer(model=model)
trainer.setup_training(
coco_annotation_path="./annotations/instances_train2017.json",
image_dir="./train2017"
)
trainer.train(epochs=100)from cva_net import TrainingConfig
from cva_net.trainers import create_trainer
config = TrainingConfig(
model_name="efficientnet_b0",
task="classification",
num_classes=1000,
batch_size=64,
learning_rate=0.01,
epochs=100,
mixed_precision=True
)
trainer = create_trainer(config)
trainer.fit()
trainer.export_model("my_model.onnx")- ResNet, ResNeXt
- EfficientNet, EfficientNetV2
- Vision Transformers (ViT, DeiT)
- MobileNet, ShuffleNet
- Faster R-CNN
- YOLO (v5, v8, v11)
- SSD
- RetinaNet
- Mask R-CNN
- U-Net
- DeepLab
- FCN
- Swin Transformers
- DETR
- ConvNeXt
- MLP-Mixer
Run the test suite to verify installation:
# Run all tests
make test
We welcome contributions from the community! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
make dev_install # Install development dependencies
make lint # Run code formatting
make type-check # Run static type checkingThis project is licensed under the MIT License. See the LICENSE file for details.
For questions, suggestions, or support:
- Maintainer: CONSOLE ART CYBERNETIC
- Email: dr.mokira@gmail.com
- GitHub: CA CYBERNETIC
- Documentation: Read the Docs
- Issues: GitHub Issues
Start building intelligent vision systems today! 🚀