File size: 3,797 Bytes
4f01b55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a38f9c
4f01b55
 
f23ef33
 
 
 
 
0a7599e
8a38f9c
9dedc3b
8a38f9c
 
9dedc3b
be4559a
8a38f9c
0a7599e
8a38f9c
 
 
 
 
 
0a7599e
8a38f9c
c61c435
0a7599e
 
8a38f9c
0a7599e
 
 
 
 
dc8870b
0a7599e
 
 
 
39a03b5
 
0a7599e
 
dc8870b
39a03b5
0a7599e
 
dc8870b
 
 
 
 
 
 
 
0a7599e
 
dc8870b
 
 
 
 
7bfa32a
8a38f9c
443192c
8a38f9c
951889b
8a38f9c
 
951889b
 
 
 
 
 
1509372
c61c435
8a38f9c
7bfa32a
8a38f9c
951889b
8a38f9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7f569e3
8a38f9c
 
0a7599e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
---

language: en
library_name: keras
tags:
- image-classification
- transfer-learning
- computer-vision
- keras
- tensorflow
- multiclass-classification
license: mit
datasets:
- custom
model-type: multi-model-repository
author: Thyagharajan K K
pipeline_tag: image-classification
inference: true
app_file: app.py
---


# 🧠 KKT-HF-TransferLearning-Models
  
## **Ready-to-Use Transfer Learning Models for Image Classification**

**Created by [Thyagharajan K K](https://huggingface.co/kkthyagharajan)**

[![Hugging Face Hub](https://img.shields.io/badge/HuggingFace-Repository-orange?logo=huggingface)](https://huggingface.co/kkthyagharajan/KKT-HF-TransferLearning-Models)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Made with Keras](https://img.shields.io/badge/Made%20with-Keras-red?logo=keras)](https://keras.io/)
[![TensorFlow](https://img.shields.io/badge/Framework-TensorFlow-orange?logo=tensorflow)](https://www.tensorflow.org/)
[![KKT_DL_Package](https://img.shields.io/badge/Package-KKT__DL__Package-blue?logo=python)](https://github.com/kkthyagharajan/KKT_DL_Package)

---

## πŸ“˜ Overview  
This repository hosts a **collection of pretrained image-classification models** created using **Transfer Learning** in Keras/TensorFlow.  
Each subdirectory contains:  
- A trained `.keras` model file  
- A `class_names.txt` file  
- A `Test` folder with example test images  

You can use these models **programmatically** or through an **interactive demo app** powered by Gradio or Streamlit.

---

## 🧩 Programmatic Usage

```python

from KKT_DL_Package.utils.KKT_predictions import (

    multiclass_prediction_return,

    display_images_gui,

    get_hf_model_img_labels_local_path,

)



IMG_SIZE = (300, 300)



model_full_path, test_folder_path, class_names = (

    get_hf_model_img_labels_local_path(

    "kkthyagharajan/KKT-HF-TransferLearning-Models",

    IMG_SIZE,

    force_refresh=False,  # Won’t redownload if cached

    )

)



# Run predictions and display results

all_image_paths, all_predicted_labels, all_confidences = (

    multiclass_prediction_return(

        model_full_path,

        test_folder_path,

        class_names,

        IMG_SIZE,

    )

)



display_images_gui(

    all_image_paths,

    all_predicted_labels,

    IMG_SIZE,

)

```
---

## πŸš€ Interactive Demo App  

### 🧩 Option 1: Run directly on Hugging Face  
This Space includes a web app defined by `app.py`.
### πŸ’» Option 2: Run locally using Gradio or Streamlit
  
```bash

pip install -r requirements.txt

python app.py   # or

streamlit run app.py

```

---

## πŸ“ Repository Structure

```



KKT-HF-TransferLearning-Models/          ← Root directory (your HF repo root)

β”‚

β”œβ”€β”€ Insect_Inception_V3/                 ← Model 1 directory

β”‚   β”œβ”€β”€ insect_inception_v3_model.keras  ← Saved model file

β”‚   β”œβ”€β”€ class_names.txt                  ← Corresponding class labels

β”‚   └── InsectTest/                      ← Test image folder

β”‚       β”œβ”€β”€ image_001.jpg

β”‚       β”œβ”€β”€ image_002.jpg

β”‚       └── ...

β”‚

β”œβ”€β”€ Insect_MobileNetV2/               ← Model 2 directory (example)

β”‚   β”œβ”€β”€ insect_mobilenet_v2_model.keras

β”‚   β”œβ”€β”€ class_names.txt

β”‚   └── InsectTest/

β”‚       β”œβ”€β”€ test1.jpg

β”‚       β”œβ”€β”€ test2.jpg

β”‚       └── ...

β”‚

β”œβ”€β”€ Insect_ResNet50/

β”‚   β”œβ”€β”€ insect_resnet50_model.keras

β”‚   β”œβ”€β”€ class_names.txt

β”‚   └── InsectTest/

β”‚       β”œβ”€β”€ imgA.jpg

β”‚       β”œβ”€β”€ imgB.jpg

β”‚       └── ...

β”‚

└── README.md                            



```