ImageCaptionGenerator is a Flask application that utilizes TensorFlow to generate descriptions for images. It provides an API endpoint that accepts a base64-encoded JPEG image and returns a description for the given image.
To use this application, you need to communicate with port 5000 of the Docker container. Make a POST request to http://localhost:5000/ask
with the image data provided in the request body as JSON, like this:
{
"img": "base64-encoded-image-data"
}
The application uses a TensorFlow model trained on the Flickr8K dataset to generate descriptions for images. It leverages deep learning techniques to analyze the provided image and generate a human-readable description. The model is included in the Docker image, so no additional setup is required.
To run the application locally using Docker, follow these steps:
-
Pull the Docker image from Docker Hub:
docker pull wasinuddy/image-2-text:v1
-
Run the Docker container:
docker run -p 5000:5000 wasinuddy/image-2-text:v1
This command maps port 5000 of your local machine to port 5000 of the Docker container, allowing you to access the Flask application at
http://localhost:5000/ask
.
To run the application without using Docker, follow these steps: ( Highly not recommended installing TensorFlow can be quite tricky)
-
Install all dependencies
pip install -r requirements.txt
-
Run the server
python app.py
Generated Description: mountain biker rides through the forest
Contributions are welcome! If you'd like to contribute to this project
This project is licensed under the MIT License.