|
| 1 | +# mlenv |
| 2 | + |
| 3 | +A comprehensive machine learning environment and toolkit built with modern Python packaging and containerized deployment. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +`mlenv` provides a ready-to-use machine learning environment with popular ML/AI libraries and frameworks. It's designed for data scientists, ML engineers, and researchers who need a consistent, reproducible environment for machine learning projects. |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- **Deep Learning**: PyTorch ecosystem (torch, torchaudio, torchvision) |
| 12 | +- **NLP & Transformers**: Hugging Face transformers and hub integration |
| 13 | +- **Computer Vision**: OpenCV and Ultralytics (YOLOv8+) |
| 14 | +- **Web Interfaces**: FastAPI for APIs and Gradio for interactive demos |
| 15 | +- **Data Analysis**: Pandas, NumPy for data manipulation |
| 16 | +- **Financial Analysis**: mplfinance for financial data visualization |
| 17 | +- **Interactive Computing**: Jupyter kernel support |
| 18 | +- **Gaming/Graphics**: Pygame for game development and graphics |
| 19 | +- **Containerized**: Docker support with multi-architecture builds |
| 20 | +- **Modern Packaging**: Uses uv for fast dependency management |
| 21 | + |
| 22 | +## Requirements |
| 23 | + |
| 24 | +- Python 3.11 or higher |
| 25 | +- Docker (optional, for containerized deployment) |
| 26 | + |
| 27 | +## Installation |
| 28 | + |
| 29 | +### Using uv (recommended) |
| 30 | + |
| 31 | +```bash |
| 32 | +# Install uv if you haven't already |
| 33 | +pip install uv |
| 34 | + |
| 35 | +# Clone the repository |
| 36 | +git clone https://github.com/pnstack/mlenv.git |
| 37 | +cd mlenv |
| 38 | + |
| 39 | +# Install dependencies |
| 40 | +uv sync |
| 41 | +``` |
| 42 | + |
| 43 | +### Using pip |
| 44 | + |
| 45 | +```bash |
| 46 | +# Clone the repository |
| 47 | +git clone https://github.com/pnstack/mlenv.git |
| 48 | +cd mlenv |
| 49 | + |
| 50 | +# Install dependencies |
| 51 | +pip install -e . |
| 52 | +``` |
| 53 | + |
| 54 | +### Using Docker |
| 55 | + |
| 56 | +```bash |
| 57 | +# Build the Docker image |
| 58 | +docker build -t mlenv . |
| 59 | + |
| 60 | +# Run a Python script |
| 61 | +docker run --rm -v $(pwd):/workspace mlenv /workspace/hello.py |
| 62 | + |
| 63 | +# Run interactively |
| 64 | +docker run --rm -it mlenv |
| 65 | +``` |
| 66 | + |
| 67 | +## Quick Start |
| 68 | + |
| 69 | +Test the installation with the included hello script: |
| 70 | + |
| 71 | +```bash |
| 72 | +python hello.py |
| 73 | +``` |
| 74 | + |
| 75 | +This should output: `Hello from mlenv!` |
| 76 | + |
| 77 | +## Key Dependencies |
| 78 | + |
| 79 | +| Package | Purpose | |
| 80 | +|---------|---------| |
| 81 | +| **torch, torchaudio, torchvision** | PyTorch deep learning framework | |
| 82 | +| **transformers** | Hugging Face transformers for NLP | |
| 83 | +| **ultralytics** | YOLOv8+ object detection | |
| 84 | +| **opencv-python** | Computer vision library | |
| 85 | +| **fastapi** | Modern web framework for APIs | |
| 86 | +| **gradio** | Interactive ML demos and UIs | |
| 87 | +| **pandas, numpy** | Data manipulation and analysis | |
| 88 | +| **mplfinance** | Financial data visualization | |
| 89 | +| **pygame** | Game development and graphics | |
| 90 | + |
| 91 | +## Development |
| 92 | + |
| 93 | +### Running Tests |
| 94 | + |
| 95 | +```bash |
| 96 | +pytest |
| 97 | +``` |
| 98 | + |
| 99 | +### Code Style |
| 100 | + |
| 101 | +```bash |
| 102 | +# Check code style |
| 103 | +pep8 . |
| 104 | +``` |
| 105 | + |
| 106 | +### Docker Development |
| 107 | + |
| 108 | +The project includes a multi-stage Dockerfile optimized for production use: |
| 109 | + |
| 110 | +```bash |
| 111 | +# Build for development |
| 112 | +docker build -t mlenv:dev . |
| 113 | + |
| 114 | +# Build for production with optimizations |
| 115 | +docker build -t mlenv:prod --target=base . |
| 116 | +``` |
| 117 | + |
| 118 | +## CI/CD |
| 119 | + |
| 120 | +The project uses GitHub Actions for automated: |
| 121 | +- Multi-architecture Docker builds (linux/amd64, linux/arm64) |
| 122 | +- Container publishing to GitHub Container Registry |
| 123 | +- Automated testing on push and pull requests |
| 124 | + |
| 125 | +## Contributing |
| 126 | + |
| 127 | +1. Fork the repository |
| 128 | +2. Create a feature branch (`git checkout -b feature/amazing-feature`) |
| 129 | +3. Commit your changes (`git commit -m 'Add some amazing feature'`) |
| 130 | +4. Push to the branch (`git push origin feature/amazing-feature`) |
| 131 | +5. Open a Pull Request |
| 132 | + |
| 133 | +## License |
| 134 | + |
| 135 | +This project is open source. Please check the repository for license details. |
| 136 | + |
| 137 | +## Support |
| 138 | + |
| 139 | +For questions, issues, or contributions, please open an issue on the GitHub repository. |
0 commit comments