JohnChiu commited on
Commit
b950b3d
·
1 Parent(s): 81ba37c
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -38,7 +38,7 @@ def load_bin(file):
38
  norm_img = (img - img.min()) / (img.max() + 1e-8)
39
  img_uint8 = (norm_img * 255).astype(np.uint8)
40
 
41
- img_zoomed = np.repeat(np.repeat(img_uint8, 2, axis=0), 2, axis=1) # (96→192, 240→480)
42
 
43
  return img_zoomed, volume
44
 
@@ -46,8 +46,8 @@ def load_bin(file):
46
  def plot_pixel_histogram(evt: gr.SelectData, volume):
47
  # print("evt:", evt)
48
  x, y = evt.index # Gradio SelectData 对象
49
- x = x // 2
50
- y = y // 2
51
  values = volume[y, x, :]
52
  fig = go.Figure()
53
  fig.add_trace(go.Scatter(y=values, mode="lines+markers"))
 
38
  norm_img = (img - img.min()) / (img.max() + 1e-8)
39
  img_uint8 = (norm_img * 255).astype(np.uint8)
40
 
41
+ img_zoomed = np.repeat(np.repeat(img_uint8, 4, axis=0), 4, axis=1) # (96→192, 240→480)
42
 
43
  return img_zoomed, volume
44
 
 
46
  def plot_pixel_histogram(evt: gr.SelectData, volume):
47
  # print("evt:", evt)
48
  x, y = evt.index # Gradio SelectData 对象
49
+ x = x // 4
50
+ y = y // 4
51
  values = volume[y, x, :]
52
  fig = go.Figure()
53
  fig.add_trace(go.Scatter(y=values, mode="lines+markers"))