Spaces:
Sleeping
Sleeping
Commit ·
ccef6d5
1
Parent(s): d23d0ea
updates to app.py
Browse files
app.py
CHANGED
|
@@ -4,24 +4,30 @@ import numpy as np
|
|
| 4 |
import cv2
|
| 5 |
from huggingface_hub import from_pretrained_keras
|
| 6 |
|
| 7 |
-
st.header("
|
| 8 |
st.subheader("Iteration to improve demo")
|
| 9 |
st.markdown(
|
| 10 |
"""
|
| 11 |
-
Demo for testing image segmentation
|
| 12 |
"""
|
| 13 |
)
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
Technical
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
## Select and load the model
|
| 27 |
model_id = "SerdarHelli/Segmentation-of-Teeth-in-Panoramic-X-ray-Image-Using-U-Net"
|
|
@@ -78,7 +84,7 @@ if archivo_imagen is not None:
|
|
| 78 |
## Load the image with PIL, display it, and convert it to a NumPy array
|
| 79 |
img = Image.open(archivo_imagen)
|
| 80 |
st.image(img, width=850)
|
| 81 |
-
img = np.
|
| 82 |
|
| 83 |
## Process the image for model input
|
| 84 |
img_cv = convertir_one_channel(img)
|
|
|
|
| 4 |
import cv2
|
| 5 |
from huggingface_hub import from_pretrained_keras
|
| 6 |
|
| 7 |
+
st.header("tooth detection and segmentation in panoramic X-Rays")
|
| 8 |
st.subheader("Iteration to improve demo")
|
| 9 |
st.markdown(
|
| 10 |
"""
|
| 11 |
+
Demo for testing image segmentation CNN model
|
| 12 |
"""
|
| 13 |
)
|
| 14 |
|
| 15 |
+
st.markdown(
|
| 16 |
+
"""
|
| 17 |
+
### Technical overview
|
| 18 |
+
|
| 19 |
+
* **Architecture:** It utilizes the U-Net architecture, a popular "encoder-decoder" convolutional neural network (CNN) specifically optimized for biomedical image segmentation where pixel-level accuracy is critical.
|
| 20 |
+
* **Performance:** In the accompanying research, the model achieved a Dice overlap score of 95.4% for overall teeth segmentation.
|
| 21 |
+
* **Post-processing:** A key highlight of this specific implementation is the use of grayscale morphological filtering and operations applied to the sigmoid output. This reduces tooth counting errors significantly (from 26.8% down to roughly 6.2%).
|
| 22 |
+
* **Dataset:** The model was trained on a relatively small but highly curated dataset (approximately 105 to 116 panoramic images) based on work by Abdi et al. (2015).
|
| 23 |
+
|
| 24 |
+
### Key applications
|
| 25 |
+
|
| 26 |
+
* **Clinical diagnosis:** Assists dentists in identifying the boundaries of individual teeth to detect caries, lesions, or bone loss.
|
| 27 |
+
* **Forensics and identification:** Automates the process of identifying dental patterns for human remains or age/gender determination.
|
| 28 |
+
* **Treatment planning:** Provides a baseline for orthodontic therapy workups by isolating dental structures from the surrounding mandible and maxilla.
|
| 29 |
+
"""
|
| 30 |
+
)
|
| 31 |
|
| 32 |
## Select and load the model
|
| 33 |
model_id = "SerdarHelli/Segmentation-of-Teeth-in-Panoramic-X-ray-Image-Using-U-Net"
|
|
|
|
| 84 |
## Load the image with PIL, display it, and convert it to a NumPy array
|
| 85 |
img = Image.open(archivo_imagen)
|
| 86 |
st.image(img, width=850)
|
| 87 |
+
img = np.array(img) #Creates a writable copy
|
| 88 |
|
| 89 |
## Process the image for model input
|
| 90 |
img_cv = convertir_one_channel(img)
|