Welcome to the Text-to-Image Generation project! This repository contains a complete implementation of a model that generates images from textual descriptions. We build everything from scratch, using custom neural networks and integrating them with a web application.
This project includes:
- Model Architecture: Custom neural network models for generating images from text descriptions.
- Training Scripts: Code to train the model on your own data.
- Evaluation: Metrics to assess the quality of generated images.
- Web Interface: An interactive webpage to input text and view generated images.
- Train your own model using custom architectures.
- Interactive web interface for text-to-image generation.
- Metrics for evaluating image quality, including FID and BLEU scores.
- Modular and clean codebase with separate components for data handling, model building, training, evaluation, and web integration.
- Python 3.8 or higher
- Flask
- PyTorch
- Other Python dependencies listed in
requirements.txt
-
Clone the repository:
git clone https://github.com/Gaurav-Jaiswal-1/Text2Image-Generation.git cd text-to-image-generation
-
Install dependencies:
pip install -r requirements.txt
-
Preprocess the Data: Prepare your dataset by running:
python scripts/preprocess_data.py
-
Train the Model: Start training the model with:
python training/train.py --config config.yaml
-
Monitor Training: Use TensorBoard to visualize the training process:
tensorboard --logdir logs/
-
Start the Backend Server:
python web/backend/server.py
-
Access the Web Interface: Open your web browser and go to
http://localhost:5000
to use the interactive text-to-image generation interface.
To generate images without using the web interface:
python scripts/generate_images.py --text "A sunny beach with palm trees"
Assess the quality of the generated images:
python evaluation/evaluate.py --model checkpoints/generator.pth
text-to-image-generation/
├── data/ # Datasets and preprocessing scripts
├── models/ # Custom neural network models
├── training/ # Training scripts and loss functions
├── evaluation/ # Evaluation metrics and visualization
├── web/ # Web application (frontend and backend)
├── utils/ # Utility functions (logging, checkpointing, etc.)
├── scripts/ # Utility scripts (data processing, etc.)
├── tests/ # Unit tests for various components
├── docs/ # Documentation
├── requirements.txt # Python dependencies
├── setup.py # Installation script
├── README.md # Project overview (you are here)
└── CONTRIBUTING.md # Contribution guidelines
- README.md: Overview and instructions.
- CONTRIBUTING.md: How to contribute to this project.
- docs/CHANGELOG.md: Change log for tracking updates.
We welcome contributions to enhance this project. Please refer to the CONTRIBUTING.md for details on how to get involved.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or issues, please open an issue on this repository or contact us at jaiswalgaurav863@gmail.com