Upload README.md
Browse filesAdded two new optional app instructions
README.md
CHANGED
|
@@ -15,67 +15,34 @@ model-type: multi-model-repository
|
|
| 15 |
author: Thyagharajan K K
|
| 16 |
pipeline_tag: image-classification
|
| 17 |
inference: true
|
|
|
|
| 18 |
---
|
| 19 |
|
| 20 |
# π§ KKT-HF-TransferLearning-Models
|
| 21 |
### Transfer Learning Models Collection for Image Classification
|
| 22 |
-
Created by
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
-
β
|
| 29 |
-
βββ Insect_Inception_V3/ β Model 1 directory
|
| 30 |
-
β βββ insect_inception_v3_model.keras β Saved model file
|
| 31 |
-
β βββ class_names.txt β Corresponding class labels
|
| 32 |
-
β βββ InsectTest/ β Test image folder
|
| 33 |
-
β βββ image_001.jpg
|
| 34 |
-
β βββ image_002.jpg
|
| 35 |
-
β βββ ...
|
| 36 |
-
β
|
| 37 |
-
βββ Insect_MobileNetV2/ β Model 2 directory (example)
|
| 38 |
-
β βββ insect_mobilenet_v2_model.keras
|
| 39 |
-
β βββ class_names.txt
|
| 40 |
-
β βββ InsectTest/
|
| 41 |
-
β βββ test1.jpg
|
| 42 |
-
β βββ test2.jpg
|
| 43 |
-
β βββ ...
|
| 44 |
-
β
|
| 45 |
-
βββ Insect_ResNet50/
|
| 46 |
-
β βββ insect_resnet50_model.keras
|
| 47 |
-
β βββ class_names.txt
|
| 48 |
-
β βββ InsectTest/
|
| 49 |
-
β βββ imgA.jpg
|
| 50 |
-
β βββ imgB.jpg
|
| 51 |
-
β βββ ...
|
| 52 |
-
β
|
| 53 |
-
βββ README.md β (optional, highly recommended)
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
- A `.keras` TensorFlow model
|
| 59 |
-
- A `class_names.txt` file listing class labels
|
| 60 |
-
- An `Test/` folder with example test images
|
| 61 |
|
| 62 |
---
|
| 63 |
|
| 64 |
-
##
|
| 65 |
-
|
| 66 |
-
You can load any model from this repository directly in Python using the helper functions in **`KKT_DL_Package`**.
|
| 67 |
-
|
| 68 |
-
### π§© Example Code
|
| 69 |
|
| 70 |
```python
|
| 71 |
-
# -*- coding: utf-8 -*-
|
| 72 |
-
"""
|
| 73 |
-
Created on Sat Nov 8 14:07:38 2025
|
| 74 |
-
@author: Thyagharajan
|
| 75 |
-
|
| 76 |
-
Example: Using a Hugging Face model programmatically
|
| 77 |
-
"""
|
| 78 |
-
|
| 79 |
from KKT_DL_Package.utils.KKT_predictions import (
|
| 80 |
multiclass_prediction_return,
|
| 81 |
display_images_gui,
|
|
@@ -106,24 +73,49 @@ display_images_gui(
|
|
| 106 |
IMG_SIZE,
|
| 107 |
)
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
-
|
|
|
|
|
|
|
| 113 |
|
| 114 |
-
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
-
Returns:
|
| 118 |
-
The full local path to the model file
|
| 119 |
-
The local test folder path
|
| 120 |
-
The list of class names
|
| 121 |
|
| 122 |
-
Parameters
|
| 123 |
-
Argument Description
|
| 124 |
-
repoid Hugging Face repo ID (e.g. "kkthyagharajan/KKT-HF-TransferLearning-Models")
|
| 125 |
-
img_size Tuple, e.g. (300, 300) matching model input
|
| 126 |
-
force_refresh If True, forces re-download even if cached locally
|
| 127 |
|
| 128 |
-
Returns:
|
| 129 |
-
`model_full_path, test_folder_path, class_names`
|
|
|
|
| 15 |
author: Thyagharajan K K
|
| 16 |
pipeline_tag: image-classification
|
| 17 |
inference: true
|
| 18 |
+
app_file: app.py
|
| 19 |
---
|
| 20 |
|
| 21 |
# π§ KKT-HF-TransferLearning-Models
|
| 22 |
### Transfer Learning Models Collection for Image Classification
|
| 23 |
+
**Created by [Thyagharajan K K](https://huggingface.co/kkthyagharajan)**
|
| 24 |
|
| 25 |
+
[](https://huggingface.co/kkthyagharajan/KKT-HF-TransferLearning-Models)
|
| 26 |
+
[](LICENSE)
|
| 27 |
+
[](https://keras.io/)
|
| 28 |
+
[](https://www.tensorflow.org/)
|
| 29 |
|
| 30 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
## π Overview
|
| 33 |
+
This repository hosts a **collection of pretrained image-classification models** created using **Transfer Learning** in Keras/TensorFlow.
|
| 34 |
+
Each subdirectory contains:
|
| 35 |
+
- A trained `.keras` model file
|
| 36 |
+
- A `class_names.txt` file
|
| 37 |
+
- A `Test` folder with example test images
|
| 38 |
|
| 39 |
+
You can use these models **programmatically** or through an **interactive demo app** powered by Gradio or Streamlit.
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
---
|
| 42 |
|
| 43 |
+
## π§© Programmatic Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
from KKT_DL_Package.utils.KKT_predictions import (
|
| 47 |
multiclass_prediction_return,
|
| 48 |
display_images_gui,
|
|
|
|
| 73 |
IMG_SIZE,
|
| 74 |
)
|
| 75 |
|
| 76 |
+
---
|
| 77 |
+
## π Interactive Demo App
|
| 78 |
+
|
| 79 |
+
### π§© Option 1: Run directly on Hugging Face
|
| 80 |
+
This Space includes a web app defined by `app.py`.
|
| 81 |
|
| 82 |
+
### π» Option 2: Run locally using Gradio or Streamlit
|
| 83 |
+
pip install -r requirements.txt
|
| 84 |
+
python app.py OR streamlit run app.py
|
| 85 |
|
| 86 |
+
---
|
| 87 |
+
## π Repository Structure
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
KKT-HF-TransferLearning-Models/ β Root directory (your HF repo root)
|
| 91 |
+
β
|
| 92 |
+
βββ Insect_Inception_V3/ β Model 1 directory
|
| 93 |
+
β βββ insect_inception_v3_model.keras β Saved model file
|
| 94 |
+
β βββ class_names.txt β Corresponding class labels
|
| 95 |
+
β βββ InsectTest/ β Test image folder
|
| 96 |
+
β βββ image_001.jpg
|
| 97 |
+
β βββ image_002.jpg
|
| 98 |
+
β βββ ...
|
| 99 |
+
β
|
| 100 |
+
βββ Insect_MobileNetV2/ β Model 2 directory (example)
|
| 101 |
+
β βββ insect_mobilenet_v2_model.keras
|
| 102 |
+
β βββ class_names.txt
|
| 103 |
+
β βββ InsectTest/
|
| 104 |
+
β βββ test1.jpg
|
| 105 |
+
β βββ test2.jpg
|
| 106 |
+
β βββ ...
|
| 107 |
+
β
|
| 108 |
+
βββ Insect_ResNet50/
|
| 109 |
+
β βββ insect_resnet50_model.keras
|
| 110 |
+
β βββ class_names.txt
|
| 111 |
+
β βββ InsectTest/
|
| 112 |
+
β βββ imgA.jpg
|
| 113 |
+
β βββ imgB.jpg
|
| 114 |
+
β βββ ...
|
| 115 |
+
β
|
| 116 |
+
βββ README.md β (optional, highly recommended)
|
| 117 |
+
|
| 118 |
+
```
|
| 119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
|
|
|
|
|
|