kritsg commited on
Commit
d8edf39
·
1 Parent(s): 7dd304e

removing hardcoded aspects

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,4 +1,6 @@
1
  from cgitb import enable
 
 
2
  import numpy as np
3
  import gradio as gr
4
  """An example of generating a gif explanation for an image of my dog."""
@@ -21,6 +23,7 @@ BLENHEIM_SPANIEL_CLASS = 156
21
 
22
  def get_image_data(image_name):
23
  """Gets the image data and model."""
 
24
  if (image_name == "imagenet_diego.png"):
25
  image = get_dataset_by_name("imagenet_diego", get_label=False)
26
  model_and_data = process_imagenet_get_model(image)
@@ -39,7 +42,7 @@ def segmentation_generation(image_name, c_width, n_top, n_gif_imgs):
39
  n_top_segs = n_top
40
  n_gif_images = n_gif_imgs
41
  image, model_and_data = get_image_data(image_name)
42
-
43
  # Unpack datax
44
  xtest = model_and_data["xtest"]
45
  ytest = model_and_data["ytest"]
 
1
  from cgitb import enable
2
+ from pyexpat import model
3
+ from statistics import mode
4
  import numpy as np
5
  import gradio as gr
6
  """An example of generating a gif explanation for an image of my dog."""
 
23
 
24
  def get_image_data(image_name):
25
  """Gets the image data and model."""
26
+ image, model_and_data = [None, None]
27
  if (image_name == "imagenet_diego.png"):
28
  image = get_dataset_by_name("imagenet_diego", get_label=False)
29
  model_and_data = process_imagenet_get_model(image)
 
42
  n_top_segs = n_top
43
  n_gif_images = n_gif_imgs
44
  image, model_and_data = get_image_data(image_name)
45
+ print("model_and_data", model_and_data)
46
  # Unpack datax
47
  xtest = model_and_data["xtest"]
48
  ytest = model_and_data["ytest"]