jpterry commited on
Commit
ae884c3
1 Parent(s): 237716a

input to RGB at end

Browse files
Files changed (2) hide show
  1. app.py +6 -2
  2. requirements.txt +1 -4
app.py CHANGED
@@ -7,9 +7,10 @@ import numpy as np
7
  # import onnx
8
  import onnxruntime as ort
9
  # from onnx import helper
10
- from optimum.onnxruntime import ORTModel
11
 
12
- import pandas as pd
 
13
 
14
  from scipy import special
15
 
@@ -167,6 +168,9 @@ def predict_and_analyze(model_name, num_channels, dim, image):
167
  activation_1 = normalize_array(activation_1)
168
  activation_2 = normalize_array(activation_2)
169
 
 
 
 
170
  print("Plotting")
171
 
172
  origin = 'lower'
 
7
  # import onnx
8
  import onnxruntime as ort
9
  # from onnx import helper
10
+ # from optimum.onnxruntime import ORTModel
11
 
12
+ # import pandas as pd
13
+ from PIL import Image
14
 
15
  from scipy import special
16
 
 
168
  activation_1 = normalize_array(activation_1)
169
  activation_2 = normalize_array(activation_2)
170
 
171
+ # convert input image to RGB
172
+ input_image = Image.fromarray(np.uint8(cm.magma(input_image)*255))
173
+
174
  print("Plotting")
175
 
176
  origin = 'lower'
requirements.txt CHANGED
@@ -2,8 +2,5 @@ torch
2
  numpy
3
  matplotlib
4
  scipy
5
- onnx
6
  onnxruntime
7
- streamlit
8
- onnx2pytorch
9
- optimum
 
2
  numpy
3
  matplotlib
4
  scipy
 
5
  onnxruntime
6
+ Pillow