Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
6.2.0
metadata
title: Image Captioning Model
emoji: π»
colorFrom: pink
colorTo: purple
sdk: gradio
sdk_version: 6.0.2
app_file: app.py
pinned: false
license: mit
short_description: Image_Captioning_Model
Image Captioning Model - Hugging Face Deployment
This folder contains everything needed to deploy the Image Captioning Model on Hugging Face Spaces.
π¦ Files
app.py- Gradio application (rebuilds model architecture and loads weights)requirements.txt- Python dependenciesmodel_weights.h5- Model weights only (22 MB)tokenizer_data.json- Tokenizer vocabulary (JSON format)model_config.pkl- Model configuration
π Quick Deploy to Hugging Face Spaces
- Go to Hugging Face Spaces
- Click "Create new Space"
- Choose:
- Name:
image-captioning-model(or your choice) - SDK: Gradio
- Visibility: Public or Private
- Name:
- Upload all files from this folder
- Wait for build (5-10 minutes)
- Done! π
π‘ How It Works
This deployment uses a different approach than typical model loading:
- Instead of: Loading the full H5 model (which has compatibility issues)
- We do: Rebuild the model architecture in code and load only the weights
This avoids all the Keras version compatibility issues!
π§ Technical Details
- TensorFlow: 2.10.0
- Gradio: 3.50.2
- Model Architecture: CNN-RNN (InceptionV3 + LSTM)
- Weights File: 22 MB (much smaller than full model)
- Tokenizer: JSON format (no pickle compatibility issues)
β Advantages of This Approach
- β No Keras version conflicts
- β Smaller file size (22 MB vs 66 MB)
- β Works with any TensorFlow 2.x version
- β Easy to modify model architecture if needed
- β No pickle security concerns
π Notes
- The model architecture is defined in
app.py - Weights are loaded using
model.load_weights() - This is the recommended approach for deploying Keras models
Created by: Prabhar Kumar Singh GitHub: Prabhat9801/Image_Captioning_Model
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference