File size: 6,291 Bytes
338d95d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# CompI Project Structure
This document outlines the organized structure of the CompI (Compositional Intelligence) project.
## π Directory Structure
```
Project CompI/
βββ π src/ # Source code (organized modules)
β βββ π generators/ # Image generation modules
β β βββ __init__.py # Module initialization
β β βββ compi_phase1_text2image.py # Basic text-to-image
β β βββ compi_phase1_advanced.py # Advanced generation
β β βββ compi_phase1b_styled_generation.py # Style conditioning
β β βββ compi_phase1b_advanced_styling.py # Advanced styling
β β βββ compi_phase1d_evaluate_quality.py # Quality evaluation (Streamlit)
β β βββ compi_phase1d_cli_evaluation.py # Quality evaluation (CLI)
β β βββ compi_phase1e_dataset_prep.py # LoRA dataset preparation
β β βββ compi_phase1e_lora_training.py # LoRA fine-tuning
β β βββ compi_phase1e_style_generation.py # Personal style generation
β β βββ compi_phase1e_style_manager.py # LoRA style management
β βββ π models/ # Model implementations (future)
β βββ π utils/ # Utility functions
β β βββ __init__.py
β β βββ logging_utils.py
β β βββ file_utils.py
β βββ π data/ # Data processing modules (future)
β βββ π ui/ # User interface components (future)
β βββ config.py # Project configuration
β βββ setup_env.py # Environment setup script
β βββ test_setup.py # Environment testing
βββ π notebooks/ # Jupyter notebooks
β βββ 01_getting_started.ipynb # Tutorial notebook
βββ π data/ # Dataset storage
βββ π outputs/ # Generated content
β βββ images/ # Generated images
β βββ metadata/ # Generation metadata
βββ π tests/ # Unit tests (future)
βββ π run_basic_generation.py # Convenience: Basic generation
βββ π run_advanced_generation.py # Convenience: Advanced generation
βββ π run_styled_generation.py # Convenience: Style conditioning
βββ π run_advanced_styling.py # Convenience: Advanced styling
βββ π run_evaluation.py # Convenience: Quality evaluation
βββ π run_lora_training.py # Convenience: LoRA training
βββ π run_style_generation.py # Convenience: Personal style generation
βββ π requirements.txt # Python dependencies
βββ π development.md # Development roadmap
βββ π PHASE1_USAGE.md # Phase 1 usage guide
βββ π PROJECT_STRUCTURE.md # This file
βββ π .gitignore # Git ignore rules
βββ π README.md # Project overview
```
## π Usage Patterns
### Convenience Scripts (Recommended)
Run from project root for easy access:
```bash
# Basic text-to-image generation
python run_basic_generation.py "prompt here"
# Advanced generation with options
python run_advanced_generation.py "prompt" --negative "unwanted" --steps 50
# Interactive style selection
python run_styled_generation.py
# Advanced style conditioning
python run_advanced_styling.py "prompt" --style "oil painting" --mood "dramatic"
# Quality evaluation interface
python run_evaluation.py
# LoRA personal style training
python run_lora_training.py --dataset-dir datasets/my_style
# Generate with personal style
python run_style_generation.py --lora-path lora_models/my_style/checkpoint-1000 "prompt"
# LoRA personal style training
python run_lora_training.py --dataset-dir datasets/my_style
# Generate with personal style
python run_style_generation.py --lora-path lora_models/my_style/checkpoint-1000 "prompt"
```
### Direct Module Access
Run generators directly from their organized location:
```bash
# Direct access to generators
python src/generators/compi_phase1_text2image.py "prompt"
python src/generators/compi_phase1b_advanced_styling.py --list-styles
# Environment setup and testing
python src/setup_env.py
python src/test_setup.py
```
## π― Benefits of This Organization
### 1. **Clean Separation of Concerns**
- **`src/generators/`** - All image generation logic
- **`src/utils/`** - Reusable utility functions
- **`src/`** - Core project modules and configuration
- **Root level** - Convenience scripts and documentation
### 2. **Professional Python Structure**
- Proper module organization with `__init__.py` files
- Clear import paths and dependencies
- Scalable architecture for future expansion
### 3. **Easy Access**
- Convenience scripts provide simple access from project root
- Direct module access for advanced users
- Maintains backward compatibility
### 4. **Future-Ready**
- Organized structure ready for Phase 2+ implementations
- Clear places for audio processing, UI components, etc.
- Modular design supports easy testing and maintenance
## π§ Development Guidelines
### Adding New Generators
1. Create new generator in `src/generators/`
2. Add imports to `src/generators/__init__.py`
3. Create convenience script in project root if needed
4. Update documentation
### Adding New Utilities
1. Add utility functions to appropriate module in `src/utils/`
2. Update `src/utils/__init__.py` imports
3. Import in generators as needed
### Testing
1. Add tests to `tests/` directory
2. Use `src/test_setup.py` for environment verification
3. Test both convenience scripts and direct module access
## π Documentation
- **README.md** - Project overview and quick start
- **development.md** - Comprehensive development roadmap
- **PHASE1_USAGE.md** - Detailed Phase 1 usage guide
- **PROJECT_STRUCTURE.md** - This organizational guide
This structure provides a solid foundation for the CompI project's continued development through all planned phases.
|