Bachmann Roman Christian commited on
Commit
5a55548
1 Parent(s): a6ebf2a
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -291,7 +291,7 @@ def plot_predictions(input_dict, preds, masks, image_size=224):
291
  plt.close()
292
 
293
 
294
- def inference(img, num_tokens, perform_sampling, num_rgb, num_depth, num_semseg, seed):
295
  im = Image.open(img)
296
 
297
  # Center crop and resize RGB
@@ -325,7 +325,7 @@ def inference(img, num_tokens, perform_sampling, num_rgb, num_depth, num_semseg,
325
  input_dict = {k: v.to(device) for k,v in input_dict.items()}
326
 
327
 
328
- if perform_sampling:
329
  # Randomly sample masks
330
 
331
  torch.manual_seed(int(time.time())) # Random mode is random
@@ -398,4 +398,4 @@ gr.Interface(
398
  description=description,
399
  article=article,
400
  examples=examples
401
- ).launch(enable_queue=True, cache_examples=True)
 
291
  plt.close()
292
 
293
 
294
+ def inference(img, num_tokens, manual_mode, num_rgb, num_depth, num_semseg, seed):
295
  im = Image.open(img)
296
 
297
  # Center crop and resize RGB
 
325
  input_dict = {k: v.to(device) for k,v in input_dict.items()}
326
 
327
 
328
+ if not manual_mode:
329
  # Randomly sample masks
330
 
331
  torch.manual_seed(int(time.time())) # Random mode is random
 
398
  description=description,
399
  article=article,
400
  examples=examples
401
+ ).launch(enable_queue=True, cache_examples=False)