Code Monkey home page Code Monkey logo

cartoon-image-generator-using-vit-and-gpt's Introduction

๐Ÿ“š Cartoon Captioning Project

Welcome to the Cartoon Captioning Project! This project aims to generate captions for cartoon images using deep learning or transformer based techniques. You can choose between two model architectures: LSTM-CNN and ViT-GPT2.


๐ŸŒŸ Features

  • Data Loading and Preprocessing
  • Exploratory Data Analysis (EDA)
  • Model Training and Evaluation
  • Visualization of Results

๐Ÿ—๏ธ Directory Structure

cartoon_captioning/
โ”‚
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ config.yaml
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ dataset.py
โ”‚   โ””โ”€โ”€ load_data.py
โ”œโ”€โ”€ eda/
โ”‚   โ”œโ”€โ”€ eda.py
โ”‚   โ””โ”€โ”€ plot.py
โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ lstm_cnn.py
โ”‚   โ”œโ”€โ”€ vit_gpt2.py
โ”‚   โ”œโ”€โ”€ build_model.py
โ”‚   โ”œโ”€โ”€ train_model.py
โ”‚   โ””โ”€โ”€ evaluate_model.py
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ image_processing.py
โ”‚   โ””โ”€โ”€ text_processing.py
โ”œโ”€โ”€ train.py
โ””โ”€โ”€ requirements.txt


โš™๏ธ Installation

  cd cartoon-image-generator
  python -m venv cap_env
  source cap_env/bin/activate
  pip install -r requirements.txt


๐Ÿ”ง Configuration

embedding_dim: 256
units: 256
vocab_size : 10000
image_feature_dim : 100352
batch_size: 32
epochs: 2
model_save_path: 'models/saved_model'
tokenizer_path: 'models/tokenizer.pkl'
max_length: 40
model_type: 'lstm_cnn'  # or 'vit_gpt2' for using 'ViT-GPT2' model


๐Ÿš€ Running Script

python train.py --config config/config.yaml --model_type lstm_cnn

python train.py --config config/config.yaml --model_type vit_gpt2

๐Ÿ–ผ๏ธ Example Outputs

EDA

Caption Length Distribution
Common Words
Top N-Grams
Word Cloud

Models Training

Caption Length Distribution

๐ŸŒ Running App

python app.py --config config/config.yaml
http://127.0.0.1:5000

cartoon-image-generator-using-vit-and-gpt's People

Contributors

deepak2233 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.