ganteng88 commited on
Commit
03e4c7d
·
1 Parent(s): d8a6d6a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -26
app.py CHANGED
@@ -153,16 +153,7 @@ class_names.sort()
153
 
154
  examples_dir = "sample"
155
 
156
- example_image_files = [
157
- "ISIC_0000108_downsampled.jpg",
158
- "ISIC_0000142_downsampled.jpg",
159
- "ISIC_0012792_downsampled.jpg",
160
- "ISIC_0024452.jpg",
161
- "ISIC_0025957.jpg",
162
- "ISIC_0026876.jpg",
163
- "ISIC_0027385.jpg",
164
- "ISIC_0030956.jpg",
165
- ]
166
 
167
  transformation_pipeline = transforms.Compose([
168
  transforms.ToPILImage(),
@@ -229,14 +220,6 @@ with gr.Blocks() as app:
229
  with open('index.html', encoding="utf-8") as f:
230
  description = f.read()
231
 
232
- if not os.path.exists(examples_dir):
233
- os.makedirs(examples_dir)
234
-
235
- # Copy the example image files to the "sample" directory.
236
- for image_file in example_image_files:
237
- source_path = os.path.join("path_to_example_images", image_file) # Specify the source directory of the example images
238
- destination_path = os.path.join(examples_dir, image_file)
239
- shutil.copy(source_path, destination_path)
240
 
241
 
242
  # gradio code block for input and output
@@ -267,14 +250,14 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue=page_utils.KALBE_THEME_COLOR,
267
 
268
  gr.Markdown("## Image Examples")
269
  gr.Examples(
270
- examples=[os.path.join(examples_dir, "ISIC_0000108_downsampled.jpg"),
271
- os.path.join(examples_dir, "ISIC_0000142_downsampled.jpg"),
272
- os.path.join(examples_dir, "ISIC_0012792_downsampled.jpg"),
273
- os.path.join(examples_dir, "ISIC_0024452.jpg"),
274
- os.path.join(examples_dir, "ISIC_0025957.jpg"),
275
- os.path.join(examples_dir, "ISIC_0026876.jpg"),
276
- os.path.join(examples_dir, "ISIC_0027385.jpg"),
277
- os.path.join(examples_dir, "ISIC_0030956.jpg"),
278
  ],
279
  inputs=inp_img,
280
  outputs=out_txt,
 
153
 
154
  examples_dir = "sample"
155
 
156
+
 
 
 
 
 
 
 
 
 
157
 
158
  transformation_pipeline = transforms.Compose([
159
  transforms.ToPILImage(),
 
220
  with open('index.html', encoding="utf-8") as f:
221
  description = f.read()
222
 
 
 
 
 
 
 
 
 
223
 
224
 
225
  # gradio code block for input and output
 
250
 
251
  gr.Markdown("## Image Examples")
252
  gr.Examples(
253
+ examples=[os.path.join(examples_dir, "1.2.410.200067.100.3.20180329.854150923.18613.1.1.dicom.jpeg"),
254
+ #os.path.join(examples_dir, "ISIC_0000142_downsampled.jpg"),
255
+ #os.path.join(examples_dir, "ISIC_0012792_downsampled.jpg"),
256
+ #os.path.join(examples_dir, "ISIC_0024452.jpg"),
257
+ #os.path.join(examples_dir, "ISIC_0025957.jpg"),
258
+ #os.path.join(examples_dir, "ISIC_0026876.jpg"),
259
+ #os.path.join(examples_dir, "ISIC_0027385.jpg"),
260
+ #os.path.join(examples_dir, "ISIC_0030956.jpg"),
261
  ],
262
  inputs=inp_img,
263
  outputs=out_txt,