Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Latest commit

 

History

History
114 lines (75 loc) · 3.99 KB

File metadata and controls

114 lines (75 loc) · 3.99 KB
## Contributing
Contributions are welcome! To contribute to this project, please follow these steps:

Fork the repository
Create a new branch for your feature or bug fix (git checkout -b my-new-feature)
Commit your changes (git commit -am 'Add some feature')
Push to the branch (git push origin my-new-feature)
Create a new Pull Request

When submitting a Pull Request, please ensure that your code adheres to the project's coding standards and that you have included tests for any new features or bug fixes.

# Image Caption Generator with Streamlit and Transformers

This repository contains a Streamlit application that uses the Transformers library from Hugging Face to generate captions for input images. The application leverages the `VisionEncoderDecoderModel` from the `nlpconnect/vit-gpt2-image-captioning` pre-trained model.

## Contribution Steps

Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or bug fixes.

### Describe your change:

Fixes #1. There is a bug in the code that doesn't handle the edge case when the insertion of an empty string is done.

* Fix a bug or typo in an existing algorithm?

### Checklist:
ADD [x] = For Availing the point.
Blank [] = For Unselecting.

* [] This pull request is all my own work -- I have not used AI TOOL's, hence it'll be CLOSED.
* [] I know that pull requests will not be merged if they fail the automated tests.
* [] This PR only changes one file. To ease review, please open separate PRs for separate algorithms.
* [] All filenames are in all lowercase characters with no spaces or dashes.
* [] All function parameters and return values are annotated with Python type hints in .py file
* [] If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".
* [] I have read CONTRIBUTING.md.
* [] All functions and variable names follow Python naming conventions.
* [] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
* [] Documentation change?


## Features

- Upload images and generate captions
- Supports various image formats (JPG, PNG, etc.)
- Utilizes the powerful Transformer architecture for image captioning

## Requirements

- Python 3.6+
- Streamlit
- Transformers
- PyTorch
- Pillow (Python Imaging Library)

## Installation

1. Clone the repository:

```bash
git clone https://github.com/your-username/image-caption-generator.git
  1. Navigate to the project directory:
cd image-caption-generator
  1. Install the required packages:
pip install -r requirements.txt

Usage

  1. Run the Streamlit app:
streamlit run app.py
  1. The app will open in your default web browser. You can then upload an image, and the generated caption will be displayed.

Deployment

To deploy the Streamlit app, follow these steps:

  1. Create a new repository on GitHub.
  2. Commit and push your changes to the new repository.
  3. Set up a GitHub Actions workflow to build and deploy the app to GitHub Pages.

Here's an example GitHub Actions workflow file (.github/workflows/deploy.yml):

# Contents of .github/workflows/deploy.yml
# ... (include your GitHub Actions workflow configuration here)
  1. After the workflow completes successfully, your Streamlit app will be deployed and accessible via the GitHub Pages URL for your repository.

License

This project is licensed under the MIT License.


This README file provides an overview of the project, including its features, requirements, installation instructions, usage instructions, and deployment steps using GitHub Actions and GitHub Pages.

Make sure to replace `your-username` with your actual GitHub username, and include the contents of your GitHub Actions workflow file in the provided location.

Additionally, you can customize the README file further by adding sections like "Architecture," "Model Details," "Future Improvements," or any other relevant information you'd like to include.