HotshotGoku commited on
Commit
aa4569e
·
1 Parent(s): 15dbe20

changed display res of demo

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -27,6 +27,11 @@ real_files = [hf_hub_download(repo_id=REPO_ID, repo_type="dataset",filename=path
27
  # Load a sample real image for the demo
28
  real_demo_path= hf_hub_download(repo_id=REPO_ID, repo_type="dataset",filename="Experiment_grid_3x3.png", token=HF_TOKEN)
29
  real_demo = np.array(Image.open(real_demo_path).convert("RGB"))
 
 
 
 
 
30
  history_file = "history_state.json"
31
  # --------------------------------
32
 
@@ -163,10 +168,10 @@ with gr.Blocks(fill_width=True) as demo:
163
  example_ui = gr.Column(visible=True)
164
  with example_ui:
165
  gr.Markdown("### Before you begin: This are what *Real* Images look like. Click start to begin the game. ")
166
- gr.Image(value=real_demo, type="numpy", show_label=False).style(
167
- width=300, # px
168
- height=300 # px
169
- ) # set desired display height)
170
  gr.Markdown("---")
171
 
172
  # Add a Start button that WILL load images and start the timer
 
27
  # Load a sample real image for the demo
28
  real_demo_path= hf_hub_download(repo_id=REPO_ID, repo_type="dataset",filename="Experiment_grid_3x3.png", token=HF_TOKEN)
29
  real_demo = np.array(Image.open(real_demo_path).convert("RGB"))
30
+
31
+ real_demo.thumbnail((300, 300), resample=Image.LANCZOS) # now ≤300×300
32
+
33
+ # 2) Turn it into a numpy array
34
+ real_demo_small = np.array(real_demo)
35
  history_file = "history_state.json"
36
  # --------------------------------
37
 
 
168
  example_ui = gr.Column(visible=True)
169
  with example_ui:
170
  gr.Markdown("### Before you begin: This are what *Real* Images look like. Click start to begin the game. ")
171
+ gr.Image(value=real_demo_small, show_label=False) #.style(
172
+ # width=300, # px
173
+ # height=300 # px
174
+ # ) # set desired display height)
175
  gr.Markdown("---")
176
 
177
  # Add a Start button that WILL load images and start the timer