Charlie Li commited on
Commit
c28f323
1 Parent(s): 112fcdf

random based on timestamp.

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -55,17 +55,8 @@ def demo(Dataset, Model, Output_Format):
55
  elif Model == "Large-i":
56
  inkml_path = f"./derendering_supp/large-i_{Dataset}_inkml"
57
 
58
- path = f"./derendering_supp/{Dataset}/images_sample"
59
- samples = os.listdir(path)
60
- # Randomly pick a sample
61
- picked_samples = random.sample(samples, min(1, len(samples)))
62
-
63
- query_modes = ["d+t", "r+d", "vanilla"]
64
- plot_title = {"r+d": "Recognized: ", "d+t": "OCR Input: ", "vanilla": ""}
65
- text_outputs = []
66
- img_outputs = []
67
- video_outputs = []
68
  now = datetime.datetime.now()
 
69
  now = now.strftime("%Y-%m-%d %H:%M:%S")
70
  print(
71
  now,
@@ -76,6 +67,16 @@ def demo(Dataset, Model, Output_Format):
76
  "with output format:",
77
  Output_Format,
78
  )
 
 
 
 
 
 
 
 
 
 
79
  for name in picked_samples:
80
  img_path = os.path.join(path, name)
81
  img = load_and_pad_img_dir(img_path)
 
55
  elif Model == "Large-i":
56
  inkml_path = f"./derendering_supp/large-i_{Dataset}_inkml"
57
 
 
 
 
 
 
 
 
 
 
 
58
  now = datetime.datetime.now()
59
+ random.seed(now.timestamp())
60
  now = now.strftime("%Y-%m-%d %H:%M:%S")
61
  print(
62
  now,
 
67
  "with output format:",
68
  Output_Format,
69
  )
70
+ path = f"./derendering_supp/{Dataset}/images_sample"
71
+ samples = os.listdir(path)
72
+ # Randomly pick a sample
73
+ picked_samples = random.sample(samples, min(1, len(samples)))
74
+
75
+ query_modes = ["d+t", "r+d", "vanilla"]
76
+ plot_title = {"r+d": "Recognized: ", "d+t": "OCR Input: ", "vanilla": ""}
77
+ text_outputs = []
78
+ img_outputs = []
79
+ video_outputs = []
80
  for name in picked_samples:
81
  img_path = os.path.join(path, name)
82
  img = load_and_pad_img_dir(img_path)