First off, thank you for considering contributing to Custom Image Classifier! It's people like you that make this project better for everyone.
- Code of Conduct
- How Can I Contribute?
- Getting Started
- Development Setup
- Pull Request Process
- Style Guidelines
- Commit Message Guidelines
- Community
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Before creating bug reports, please check the existing issues to avoid duplicates.
When you create a bug report, please include:
- A clear and descriptive title
- Detailed steps to reproduce the issue
- Expected behavior vs. actual behavior
- Screenshots (if applicable)
- Your environment (OS, Python version, PyTorch version)
- Any relevant error messages or logs
Bug Report Template:
## Bug Description
A clear description of what the bug is.
## Steps to Reproduce
1. Go to '...'
2. Click on '...'
3. See error
## Expected Behavior
What you expected to happen.
## Actual Behavior
What actually happened.
## Environment
- OS: [e.g., macOS 13.0, Ubuntu 22.04]
- Python Version: [e.g., 3.9.7]
- PyTorch Version: [e.g., 2.1.0]
- Browser (if applicable): [e.g., Chrome 118]
## Additional Context
Any other context about the problem.Enhancement suggestions are welcome! Please:
- Use a clear and descriptive title
- Provide a detailed description of the proposed feature
- Explain why this enhancement would be useful
- Include examples of how the feature would work
- List any potential drawbacks or challenges
Documentation improvements are always appreciated! You can help by:
- Fixing typos or grammatical errors
- Adding examples or clarifications
- Creating tutorials or guides
- Improving API documentation
- Translating documentation
We love code contributions! Here's how to get started:
- Find an issue to work on or create a new one
- Comment on the issue to let others know you're working on it
- Fork the repository and create a branch
- Write your code following our style guidelines
- Test your changes thoroughly
- Submit a pull request
- Python 3.8 or higher
- Git
- Basic knowledge of PyTorch and Flask
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/your-username/custom-image-classifier.git
cd custom-image-classifier
# Add the upstream repository
git remote add upstream https://github.com/iad1tya/custom-image-classifier.gitpython -m venv venv
source venv/bin/activate # On macOS/Linux
# venv\Scripts\activate # On Windows# Install production dependencies
pip install -r requirements.txt
# Install development dependencies
pip install -r requirements-dev.txtDevelopment dependencies include:
- pytest - Testing framework
- black - Code formatter
- flake8 - Linter
- mypy - Type checker
- pre-commit - Git hooks
- pytest-cov - Coverage reporting
pre-commit installThis will automatically run checks before each commit.
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fixBranch naming conventions:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions or modifications
- Write clean, readable code
- Follow the style guidelines below
- Add tests for new functionality
- Update documentation as needed
# Run all tests
pytest
# Run tests with coverage
pytest --cov=. --cov-report=html
# Run specific tests
pytest tests/test_model.py
# Check code style
black . --check
flake8 .
# Type checking
mypy .git add .
git commit -m "feat: add new feature"See Commit Message Guidelines below.
git push origin feature/your-feature-name- Go to your fork on GitHub
- Click "New Pull Request"
- Select your branch
- Fill out the PR template
- Submit the pull request
Pull Request Checklist:
- Code follows the style guidelines
- All tests pass
- New tests added (if applicable)
- Documentation updated (if applicable)
- Commit messages follow the guidelines
- PR description clearly explains the changes
- No merge conflicts
- Linked to related issue (if applicable)
- Maintainers will review your PR
- Address any feedback or requested changes
- Once approved, your PR will be merged!
We follow PEP 8 with some modifications:
# Use Black for automatic formatting
black .
# Maximum line length: 100 characters
# Use 4 spaces for indentation (no tabs)
# Use double quotes for strings
# Add docstrings to all functions and classesExample:
def train_model(
project_name: str,
epochs: int = 10,
batch_size: int = 32,
learning_rate: float = 0.001
) -> dict:
"""
Train a model for a given project.
Args:
project_name: Name of the project
epochs: Number of training epochs
batch_size: Training batch size
learning_rate: Learning rate for optimizer
Returns:
Dictionary containing training metrics
Raises:
ValueError: If project doesn't exist
"""
# Implementation here
pass- Use ES6+ features
- Use 2 spaces for indentation
- Use semicolons
- Use camelCase for variables and functions
- Add comments for complex logic
- Use 2 spaces for indentation
- Use semantic HTML5 elements
- Keep CSS organized and commented
- Mobile-first responsive design
We follow the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, missing semicolons, etc.)
- refactor: Code refactoring
- test: Adding or updating tests
- chore: Maintenance tasks
# Feature
feat(training): add early stopping support
# Bug fix
fix(api): handle missing image parameter
# Documentation
docs(readme): update installation instructions
# Refactor
refactor(model): simplify CNN architecture
# Test
test(predictor): add unit tests for image preprocessing- Use present tense ("add feature" not "added feature")
- Use imperative mood ("move cursor to..." not "moves cursor to...")
- Keep subject line under 50 characters
- Capitalize the subject line
- No period at the end of subject line
- Separate subject from body with blank line
- Wrap body at 72 characters
- Explain what and why, not how
- Write tests for all new functionality
- Maintain or improve code coverage
- Use descriptive test names
- Follow AAA pattern (Arrange, Act, Assert)
Example:
def test_model_training():
"""Test that model training completes successfully."""
# Arrange
project_name = "test_project"
epochs = 2
# Act
result = train_model(project_name, epochs=epochs)
# Assert
assert result["success"] is True
assert result["epochs_trained"] == epochs# Run all tests
pytest
# Run with verbose output
pytest -v
# Run specific test file
pytest tests/test_model.py
# Run tests matching a pattern
pytest -k "train"
# Generate coverage report
pytest --cov=. --cov-report=html- Add docstrings to all public functions and classes
- Use Google-style docstrings
- Include type hints
- Provide examples for complex functions
- Keep README.md up to date with new features
- Add examples for new functionality
- Update installation instructions if needed
- Update CHANGELOG.md for significant changes
- Follow Keep a Changelog format
- Group changes by type (Added, Changed, Fixed, etc.)
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Email: For private inquiries
Contributors are recognized in:
- README.md acknowledgments
- CHANGELOG.md for significant contributions
- GitHub contributors page
By contributing to Custom Image Classifier, you agree that your contributions will be licensed under the MIT License.
If you have any questions about contributing, please:
- Check the documentation
- Search existing issues
- Open a new discussion
- Contact the maintainers
Thank you for contributing! 🎉
Your time and effort make this project better for everyone. We appreciate you!