muawiaimti commited on
Commit
f39ef14
·
verified ·
1 Parent(s): 310fdf4

Upload model card

Browse files
Files changed (1) hide show
  1. README.md +65 -0
README.md ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ EfficientNetB0 Eye Disease Classification Model
2
+ Model Overview
3
+ This is a pre-trained EfficientNetB0 model for eye disease classification, saved in HDF5 format (efficientnet0.h5). It classifies eye images into one of the following categories:
4
+
5
+ Classes:
6
+
7
+ Normal
8
+ Diabetic Retinopathy
9
+ Glaucoma
10
+ Myopia
11
+ AMD (Age-related Macular Degeneration)
12
+ Hypertension
13
+ Not an eye Image
14
+ Others
15
+
16
+
17
+ Architecture: EfficientNetB0
18
+
19
+ Framework: TensorFlow/Keras
20
+
21
+ Task: Image Classification
22
+
23
+ Input: Images resized to 224x224 pixels, normalized to [0, 1]
24
+
25
+ Output: Predicted disease label (one of the above classes)
26
+
27
+
28
+ Usage
29
+ To use this model for inference, you can load it using TensorFlow/Keras:
30
+
31
+ Install dependencies:
32
+ pip install tensorflow pillow numpy
33
+
34
+
35
+ Load the model in Python:
36
+ from tensorflow.keras.models import load_model
37
+ model = load_model("efficientnet0.h5")
38
+
39
+
40
+ Preprocess your image (resize to 224x224, convert to RGB if needed, normalize), then run inference:
41
+ from PIL import Image
42
+ import numpy as np
43
+ img = Image.open("your_image.jpg")
44
+ img_d = img.resize((224, 224))
45
+ if len(np.array(img_d).shape) < 3:
46
+ rgb_img = Image.new("RGB", img_d.size)
47
+ rgb_img.paste(img_d)
48
+ else:
49
+ rgb_img = img_d
50
+ rgb_img = np.array(rgb_img, dtype=np.float64)
51
+ rgb_img = rgb_img.reshape(1, 224, 224, 3)
52
+ predictions = model.predict(rgb_img)
53
+ predicted_class = int(np.argmax(predictions))
54
+ classes = ["Normal", "Diabetic Retinopathy", "Glaucoma", "Myopia", "AMD", "Hypertension", "Not an eye Image", "Others"]
55
+ predicted_disease = classes[predicted_class] if 0 <= predicted_class < len(classes) else "Unknown"
56
+
57
+
58
+
59
+ Notes
60
+
61
+ This model is hosted on Hugging Face for storage. The Inference API may not support .h5 models directly. For inference, you can download the model and run it locally, or deploy a custom backend (e.g., using Flask).
62
+ The model expects images to be preprocessed as described above.
63
+
64
+ License
65
+ Specify your license here (e.g., MIT, Apache 2.0).