alibidaran commited on
Commit
997e5d0
1 Parent(s): 69140ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -1
app.py CHANGED
@@ -4,6 +4,12 @@ import numpy as np
4
  from PIL import Image
5
  import cv2
6
  from torchvision import models,transforms
 
 
 
 
 
 
7
  core = Core()
8
 
9
  # Read model to OpenVINO Runtime
@@ -83,6 +89,44 @@ items = {
83
 
84
 
85
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
  colormap={v:[i for i in k] for k,v in color_map.items()}
88
 
@@ -122,6 +166,6 @@ demo=gr.Interface(fn=segment_image,inputs=gr.Image(type='filepath'),
122
  "R005_ch1_video_03_00-19-10-11.jpg",
123
  "R006_ch1_video_01_00-45-02-10.jpg",
124
  "R013_ch1_video_03_00-40-17-11.jpg"],
125
- #themes=gr.themes.Glass(primary_hue=gr.themes.colors.blue,secondary_hue=gr.themes.colors.blue),
126
  title="Davinci Eye(Quantized for CPU)")
127
  demo.launch()
 
4
  from PIL import Image
5
  import cv2
6
  from torchvision import models,transforms
7
+ from __future__ import annotations
8
+ from typing import Iterable
9
+ import gradio as gr
10
+ from gradio.themes.base import Base
11
+ from gradio.themes.utils import colors, fonts, sizes
12
+ import time
13
  core = Core()
14
 
15
  # Read model to OpenVINO Runtime
 
89
 
90
 
91
  }
92
+ class Davinci_Eye(Base):
93
+ def __init__(
94
+ self,
95
+ *,
96
+ primary_hue: colors.Color | str = colors.stone,
97
+ secondary_hue: colors.Color | str = colors.blue,
98
+ neutral_hue: colors.Color | str = colors.gray,
99
+ spacing_size: sizes.Size | str = sizes.spacing_md,
100
+ radius_size: sizes.Size | str = sizes.radius_md,
101
+ text_size: sizes.Size | str = sizes.text_lg,
102
+ font: fonts.Font
103
+ | str
104
+ | Iterable[fonts.Font | str] = (
105
+ fonts.GoogleFont("IBM Plex Mono"),
106
+ "ui-sans-serif",
107
+ "sans-serif",
108
+ ),
109
+ font_mono: fonts.Font
110
+ | str
111
+ | Iterable[fonts.Font | str] = (
112
+ fonts.GoogleFont("IBM Plex Mono"),
113
+ "ui-monospace",
114
+ "monospace",
115
+ ),
116
+ ):
117
+ super().__init__(
118
+ primary_hue=primary_hue,
119
+ secondary_hue=secondary_hue,
120
+ neutral_hue=neutral_hue,
121
+ spacing_size=spacing_size,
122
+ radius_size=radius_size,
123
+ text_size=text_size,
124
+ font=font,
125
+ font_mono=font_mono,
126
+ )
127
+
128
+
129
+ davincieye = Davinci_Eye()
130
 
131
  colormap={v:[i for i in k] for k,v in color_map.items()}
132
 
 
166
  "R005_ch1_video_03_00-19-10-11.jpg",
167
  "R006_ch1_video_01_00-45-02-10.jpg",
168
  "R013_ch1_video_03_00-40-17-11.jpg"],
169
+ theme=davincieye.set(loader_color='#65aab1'),
170
  title="Davinci Eye(Quantized for CPU)")
171
  demo.launch()