Prabhat9801 commited on
Commit
5439e29
Β·
verified Β·
1 Parent(s): 0b613c4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -0
README.md CHANGED
@@ -11,4 +11,64 @@ license: mit
11
  short_description: Image_Captioning_Model
12
  ---
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
11
  short_description: Image_Captioning_Model
12
  ---
13
 
14
+ # Image Captioning Model - Hugging Face Deployment
15
+
16
+ This folder contains everything needed to deploy the Image Captioning Model on Hugging Face Spaces.
17
+
18
+ ## πŸ“¦ Files
19
+
20
+ - `app.py` - Gradio application (rebuilds model architecture and loads weights)
21
+ - `requirements.txt` - Python dependencies
22
+ - `model_weights.h5` - Model weights only (22 MB)
23
+ - `tokenizer_data.json` - Tokenizer vocabulary (JSON format)
24
+ - `model_config.pkl` - Model configuration
25
+
26
+ ## πŸš€ Quick Deploy to Hugging Face Spaces
27
+
28
+ 1. Go to [Hugging Face Spaces](https://huggingface.co/spaces)
29
+ 2. Click "Create new Space"
30
+ 3. Choose:
31
+ - Name: `image-captioning-model` (or your choice)
32
+ - SDK: **Gradio**
33
+ - Visibility: Public or Private
34
+ 4. Upload all files from this folder
35
+ 5. Wait for build (5-10 minutes)
36
+ 6. Done! πŸŽ‰
37
+
38
+ ## πŸ’‘ How It Works
39
+
40
+ This deployment uses a **different approach** than typical model loading:
41
+
42
+ - **Instead of**: Loading the full H5 model (which has compatibility issues)
43
+ - **We do**: Rebuild the model architecture in code and load only the weights
44
+
45
+ This avoids all the Keras version compatibility issues!
46
+
47
+ ## πŸ”§ Technical Details
48
+
49
+ - **TensorFlow**: 2.10.0
50
+ - **Gradio**: 3.50.2
51
+ - **Model Architecture**: CNN-RNN (InceptionV3 + LSTM)
52
+ - **Weights File**: 22 MB (much smaller than full model)
53
+ - **Tokenizer**: JSON format (no pickle compatibility issues)
54
+
55
+ ## βœ… Advantages of This Approach
56
+
57
+ 1. βœ… No Keras version conflicts
58
+ 2. βœ… Smaller file size (22 MB vs 66 MB)
59
+ 3. βœ… Works with any TensorFlow 2.x version
60
+ 4. βœ… Easy to modify model architecture if needed
61
+ 5. βœ… No pickle security concerns
62
+
63
+ ## πŸ“ Notes
64
+
65
+ - The model architecture is defined in `app.py`
66
+ - Weights are loaded using `model.load_weights()`
67
+ - This is the recommended approach for deploying Keras models
68
+
69
+ ---
70
+
71
+ **Created by**: Prabhar Kumar Singh
72
+ **GitHub**: [Prabhat9801/Image_Captioning_Model](https://github.com/Prabhat9801/Image_Captioning_Model)
73
+
74
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference