Trinetra, named after the "third eye" in Hindu mythology, is a comprehensive image classification pipeline that streamlines the process from data labelling to model training and evaluation. It provides clear vision into your image data using state-of-the-art CLIP models.
- 🏷️ Automated image labelling for efficient dataset preparation
- 🧠 Fine-tuning of CLIP models for custom image classification tasks
- 🔢 Support for multiple precision formats (FP16, FP32)
- 📊 Integration with Weights & Biases for experiment tracking
- 💾 Automatic saving of best-performing models
- 🧮 Confusion matrix computation for performance analysis
- 📁 Flexible model saving in different formats (PTH, PT, ONNX)
- Ensure you have Anaconda or Miniconda installed.
- Clone the repository:
git clone https://github.com/your-username/Trinetra.git cd Trinetra
- Run the setup script generator:
python generate_setup.py
- Follow the instructions to run the generated setup script for your operating system.
If you prefer to set up manually:
- Create and activate a new Conda environment:
conda create --name trinetra python=3.8 conda activate trinetra
- Install the required packages:
pip install -r requirements.txt pip install git+https://github.com/openai/CLIP.git
To label your images using CLIP:
python src/classifier_labelling.py --data_dir "path/to/unlabelled/images" --categories "Human" "Vehicle" --output_dir "path/to/labelled/output"
In the categories argument, you can specify the categories you want to label.
To fine-tune a CLIP model on your labelled dataset:
python src/finetine_classifier.py --data_dir "path/to/labelled/dataset" --epochs 10 --batch_size 32 --learning_rate 0.001 --loss_function focal --precision FP16 --save_format pt
--data_dir
: Path to the dataset directory--epochs
: Number of training epochs--batch_size
: Batch size for training--learning_rate
: Learning rate for the optimizer--loss_function
: Loss function to use (e.g., "focal", "cce")--precision
: Precision format for training ("FP16" or "FP32")--save_format
: Format to save the model ("pth", "pt", or "onnx")--clip_model
: CLIP model to use (default: "ViT-B/32")
For a full list of options, run:
python src/finetine_classifier.py --help
Trinetra/
│
├── src/
│ ├── classifier_labelling.py
│ ├── finetine_classifier.py
│ ├── loss_functions.py
│ ├── precision_formats.py
│ └── model_saver.py
│
├── requirements.txt
├── generate_setup.py
├── README.md
└── .gitignore
- Object Detection capabilities
- Semantic and instance segmentation support
- Advanced data augmentation techniques
- Multi-GPU and distributed training optimization
- Model interpretability tools
Contributions to Trinetra are welcome! Please feel free to submit a Pull Request.
- Fork the repository on GitHub.
- Clone your forked repository locally.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with clear, descriptive messages.
- Push your changes to your fork on GitHub.
- Submit a Pull Request to the main Trinetra repository.
Trinetra has been tested on various datasets and consistently achieves high accuracy in image classification tasks. Specific performance metrics will vary based on the dataset and chosen model architecture.
This project is licensed under the MIT License. See the LICENSE file for details.
For any queries or suggestions, please open an issue on GitHub or contact the maintainer at [[email protected]].
Empower Your Vision with Trinetra! 👁️🚀
_____
_.-' `'-._
,' '.
/ \
| ___________ |
| | | |
| | ( ) | |
| |___________| 👁️ |
\ /
'. ,'
'-.._______.-'
Trinetra watches everything