Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
|
| 2 |
title: Satellite Classification Dashboardemoji: 🛰️colorFrom: bluecolorTo: purplesdk: gradiosdk_version: "5.0.2"app_file: app.pypinned: false
|
| 3 |
-
|
| 4 |
A Gradio-based application for classifying satellite images using pre-trained deep learning models. Upload a PNG, JPG, or JPEG image, select one or more models (Custom CNN, MobileNetV2, EfficientNetB0, DenseNet121), and view predictions with confidence scores and visualizations.
|
| 5 |
Quick Start
|
| 6 |
|
| 7 |
-
|
| 8 |
Local Setup:git clone https://huggingface.co/spaces/your-username/Satellite-Classification-Gradio
|
| 9 |
cd Satellite-Classification-Gradio
|
| 10 |
python -m venv venv
|
|
@@ -12,7 +12,7 @@ source venv/bin/activate # On Windows: venv\Scripts\activate
|
|
| 12 |
pip install -r requirements.txt
|
| 13 |
python app.py
|
| 14 |
|
| 15 |
-
Open http://localhost:7860
|
| 16 |
|
| 17 |
Dependencies
|
| 18 |
Listed in requirements.txt:
|
|
@@ -30,38 +30,41 @@ protobuf==3.20.3
|
|
| 30 |
Troubleshooting
|
| 31 |
Missing configuration in README
|
| 32 |
|
| 33 |
-
Cause: The README.md lacks
|
| 34 |
Fix:
|
| 35 |
-
|
| 36 |
-
|
| 37 |
Push to repository:git add README.md
|
| 38 |
-
git commit -m "
|
| 39 |
git push
|
| 40 |
|
| 41 |
|
| 42 |
Restart the Space in the Settings tab.
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
Error loading <model>: Unable to load model. Filepath is not an hdf5 file (or h5py is not available) or SavedModel
|
| 47 |
|
| 48 |
-
Cause: The model file is
|
| 49 |
Fix:
|
| 50 |
Ensure requirements.txt includes h5py==3.10.0.
|
| 51 |
-
Verify the model URL (e.g., https://huggingface.co/Bhavi23/Custom_CNN/resolve/main/best_multimodal_model.keras)
|
| 52 |
|
| 53 |
|
| 54 |
-
|
| 55 |
python -c "import tensorflow as tf; model = tf.keras.models.load_model('best_multimodal_model.keras')"
|
| 56 |
|
| 57 |
|
| 58 |
-
If
|
| 59 |
-
Alternatively, include model files in the repository:
|
|
|
|
|
|
|
| 60 |
git commit -m "Add Custom CNN model file"
|
| 61 |
git push
|
| 62 |
|
| 63 |
|
| 64 |
-
Use a Dockerfile for
|
| 65 |
WORKDIR /app
|
| 66 |
COPY requirements.txt .
|
| 67 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
@@ -70,7 +73,6 @@ EXPOSE 7860
|
|
| 70 |
CMD ["python", "app.py"]
|
| 71 |
|
| 72 |
|
| 73 |
-
Restart the Space after changes.
|
| 74 |
|
| 75 |
|
| 76 |
|
|
@@ -78,7 +80,7 @@ ModuleNotFoundError: No module named 'tensorflow'
|
|
| 78 |
|
| 79 |
Cause: TensorFlow failed to install.
|
| 80 |
Fix:
|
| 81 |
-
Verify requirements.txt includes tensorflow-cpu==2.15.0
|
| 82 |
Check build logs in the Space’s Settings tab.
|
| 83 |
Test locally:python -m venv venv
|
| 84 |
source venv/bin/activate
|
|
@@ -86,7 +88,6 @@ pip install -r requirements.txt
|
|
| 86 |
python app.py
|
| 87 |
|
| 88 |
|
| 89 |
-
Use the above Dockerfile if needed.
|
| 90 |
|
| 91 |
|
| 92 |
|
|
|
|
| 1 |
|
| 2 |
title: Satellite Classification Dashboardemoji: 🛰️colorFrom: bluecolorTo: purplesdk: gradiosdk_version: "5.0.2"app_file: app.pypinned: false
|
| 3 |
+
Satellite Classification Dashboard
|
| 4 |
A Gradio-based application for classifying satellite images using pre-trained deep learning models. Upload a PNG, JPG, or JPEG image, select one or more models (Custom CNN, MobileNetV2, EfficientNetB0, DenseNet121), and view predictions with confidence scores and visualizations.
|
| 5 |
Quick Start
|
| 6 |
|
| 7 |
+
Live Demo: Visit https://huggingface.co/spaces/your-username/Satellite-Classification-Gradio.
|
| 8 |
Local Setup:git clone https://huggingface.co/spaces/your-username/Satellite-Classification-Gradio
|
| 9 |
cd Satellite-Classification-Gradio
|
| 10 |
python -m venv venv
|
|
|
|
| 12 |
pip install -r requirements.txt
|
| 13 |
python app.py
|
| 14 |
|
| 15 |
+
Open http://localhost:7860.
|
| 16 |
|
| 17 |
Dependencies
|
| 18 |
Listed in requirements.txt:
|
|
|
|
| 30 |
Troubleshooting
|
| 31 |
Missing configuration in README
|
| 32 |
|
| 33 |
+
Cause: The README.md lacks proper YAML front matter or is not detected.
|
| 34 |
Fix:
|
| 35 |
+
Save this README.md as README.md (case-sensitive) in the repository root.
|
| 36 |
+
Ensure YAML syntax is correct (2-space indentation, quoted sdk_version).
|
| 37 |
Push to repository:git add README.md
|
| 38 |
+
git commit -m "Fix YAML front matter in README.md"
|
| 39 |
git push
|
| 40 |
|
| 41 |
|
| 42 |
Restart the Space in the Settings tab.
|
| 43 |
+
If the error persists, create a new Space to avoid caching issues.
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
Error loading <model>: Unable to load model. Filepath is not an hdf5 file (or h5py is not available) or SavedModel
|
| 48 |
|
| 49 |
+
Cause: The model file is invalid, or h5py is missing.
|
| 50 |
Fix:
|
| 51 |
Ensure requirements.txt includes h5py==3.10.0.
|
| 52 |
+
Verify the model URL (e.g., https://huggingface.co/Bhavi23/Custom_CNN/resolve/main/best_multimodal_model.keras):curl -I https://huggingface.co/Bhavi23/Custom_CNN/resolve/main/best_multimodal_model.keras
|
| 53 |
|
| 54 |
|
| 55 |
+
Test the model file locally:wget https://huggingface.co/Bhavi23/Custom_CNN/resolve/main/best_multimodal_model.keras
|
| 56 |
python -c "import tensorflow as tf; model = tf.keras.models.load_model('best_multimodal_model.keras')"
|
| 57 |
|
| 58 |
|
| 59 |
+
If invalid, check the Hugging Face repository or contact the model owner.
|
| 60 |
+
Alternatively, include model files in the repository:mkdir models
|
| 61 |
+
mv best_multimodal_model.keras models/
|
| 62 |
+
git add models/best_multimodal_model.keras
|
| 63 |
git commit -m "Add Custom CNN model file"
|
| 64 |
git push
|
| 65 |
|
| 66 |
|
| 67 |
+
Use a Dockerfile for consistency:FROM python:3.9-slim
|
| 68 |
WORKDIR /app
|
| 69 |
COPY requirements.txt .
|
| 70 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 73 |
CMD ["python", "app.py"]
|
| 74 |
|
| 75 |
|
|
|
|
| 76 |
|
| 77 |
|
| 78 |
|
|
|
|
| 80 |
|
| 81 |
Cause: TensorFlow failed to install.
|
| 82 |
Fix:
|
| 83 |
+
Verify requirements.txt includes tensorflow-cpu==2.15.0.
|
| 84 |
Check build logs in the Space’s Settings tab.
|
| 85 |
Test locally:python -m venv venv
|
| 86 |
source venv/bin/activate
|
|
|
|
| 88 |
python app.py
|
| 89 |
|
| 90 |
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
|