gera-richarte commited on
Commit
3a8d69b
1 Parent(s): 26e4985

don't resize small images

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -23,8 +23,6 @@ def open_dataset(dataset, set_name, split, batch_size, state, shard = -1):
23
  data_files = {"train":[f"{path}/{split}-{shard:05d}-of-{shards:05d}.parquet"]}
24
 
25
  if DEBUG:
26
- ds = lambda:None
27
- ds.n_shards = 1234
28
  dsi = range(100)
29
  else:
30
  ds = load_dataset(
@@ -54,7 +52,9 @@ def get_images(batch_size, state):
54
 
55
  for i in tqdm.trange(batch_size, desc=f"Getting images"):
56
  if DEBUG:
57
- image = np.random.randint(0,255,(384,384,3))
 
 
58
  metadata = {"bounds":[[1,1,4,4]], }
59
  else:
60
  try:
@@ -96,6 +96,7 @@ if __name__ == "__main__":
96
  gallery = gr.Gallery(
97
  label=ev.DATASET,
98
  interactive=False,
 
99
  columns=5, rows=2, render=False)
100
 
101
  with gr.Row():
 
23
  data_files = {"train":[f"{path}/{split}-{shard:05d}-of-{shards:05d}.parquet"]}
24
 
25
  if DEBUG:
 
 
26
  dsi = range(100)
27
  else:
28
  ds = load_dataset(
 
52
 
53
  for i in tqdm.trange(batch_size, desc=f"Getting images"):
54
  if DEBUG:
55
+ images.append(np.random.randint(0,255,(384,384,3)))
56
+ images.append(np.random.randint(0,255,(100,100,3)))
57
+
58
  metadata = {"bounds":[[1,1,4,4]], }
59
  else:
60
  try:
 
96
  gallery = gr.Gallery(
97
  label=ev.DATASET,
98
  interactive=False,
99
+ object_fit="scale-down",
100
  columns=5, rows=2, render=False)
101
 
102
  with gr.Row():