kkthyagharajan commited on
Commit
8a38f9c
Β·
verified Β·
1 Parent(s): 4f01b55

Upload README.md

Browse files

Added two new optional app instructions

Files changed (1) hide show
  1. README.md +56 -64
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 **Thyagharajan K K**
23
 
24
- ## πŸ“ Repository Structure
25
- ```
 
 
26
 
27
- KKT-HF-TransferLearning-Models/ ← Root directory (your HF repo root)
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
- Each subfolder contains:
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
- ## βš™οΈ Programmatic Usage
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
- 🧠 About the Helper Function
110
- get_hf_model_img_labels_local_path(repoid, img_size, force_refresh=False)
 
 
 
111
 
112
- This function:
 
 
113
 
114
- Downloads (or reuses cached) model and class label files from Hugging Face
115
- Loads test images from the repo
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ [![Hugging Face Hub](https://img.shields.io/badge/HuggingFace-Repository-orange?logo=huggingface)](https://huggingface.co/kkthyagharajan/KKT-HF-TransferLearning-Models)
26
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
27
+ [![Made with Keras](https://img.shields.io/badge/Made%20with-Keras-red?logo=keras)](https://keras.io/)
28
+ [![TensorFlow](https://img.shields.io/badge/Framework-TensorFlow-orange?logo=tensorflow)](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