Arslan7788 commited on
Commit
a5154de
1 Parent(s): 9655756

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -27
app.py CHANGED
@@ -5,21 +5,14 @@ from PIL import Image
5
  import numpy as np
6
  import cv2
7
  from huggingface_hub import from_pretrained_keras
8
-
9
-
10
  try:
11
  model=from_pretrained_keras("SerdarHelli/Segmentation-of-Teeth-in-Panoramic-X-ray-Image-Using-U-Net")
12
  except:
13
  model=tf.keras.models.load_model("dental_xray_seg.h5")
14
  pass
15
-
16
  st.header("Segmentation of Teeth in Panoramic X-ray Image Using UNet")
17
 
18
- examples=["107.png","108.png","109.png"]
19
- link='Check Out Our Github Repo ! [link](https://github.com/SerdarHelli/Segmentation-of-Teeth-in-Panoramic-X-ray-Image-Using-U-Net)'
20
- st.markdown(link,unsafe_allow_html=True)
21
-
22
-
23
  def load_image(image_file):
24
  img = Image.open(image_file)
25
  return img
@@ -45,31 +38,14 @@ st.subheader("Upload Dental Panoramic X-ray Image Image")
45
  image_file = st.file_uploader("Upload Images", type=["png","jpg","jpeg"])
46
 
47
 
48
- col1, col2, col3 = st.columns(3)
49
  with col1:
50
  ex=load_image(examples[0])
51
  st.image(ex,width=200)
52
  if st.button('Example 1'):
53
- image_file=examples[0]
54
-
55
- with col2:
56
- ex1=load_image(examples[1])
57
- st.image(ex1,width=200)
58
- if st.button('Example 2'):
59
- image_file=examples[1]
60
-
61
-
62
- with col3:
63
- ex2=load_image(examples[2])
64
- st.image(ex2,width=200)
65
- if st.button('Example 3'):
66
- image_file=examples[2]
67
-
68
-
69
  if image_file is not None:
70
-
71
  img=load_image(image_file)
72
-
73
  st.text("Making A Prediction ....")
74
  st.image(img,width=850)
75
 
 
5
  import numpy as np
6
  import cv2
7
  from huggingface_hub import from_pretrained_keras
 
 
8
  try:
9
  model=from_pretrained_keras("SerdarHelli/Segmentation-of-Teeth-in-Panoramic-X-ray-Image-Using-U-Net")
10
  except:
11
  model=tf.keras.models.load_model("dental_xray_seg.h5")
12
  pass
 
13
  st.header("Segmentation of Teeth in Panoramic X-ray Image Using UNet")
14
 
15
+ examples=["107.png"]
 
 
 
 
16
  def load_image(image_file):
17
  img = Image.open(image_file)
18
  return img
 
38
  image_file = st.file_uploader("Upload Images", type=["png","jpg","jpeg"])
39
 
40
 
41
+ col1 = st.columns(0)
42
  with col1:
43
  ex=load_image(examples[0])
44
  st.image(ex,width=200)
45
  if st.button('Example 1'):
46
+ image_file=examples[0]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  if image_file is not None:
 
48
  img=load_image(image_file)
 
49
  st.text("Making A Prediction ....")
50
  st.image(img,width=850)
51