Dimitre commited on
Commit
6751a7d
1 Parent(s): f5b5665

Update app.py

Browse files

Adding random seed

Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -31,9 +31,10 @@ def get_captcha(images, indexes):
31
  return fig, fake_idx
32
 
33
  def get_challenge():
 
34
  real_idx = np.random.randint(low=0, high=len(real_files), size=n_real)
35
  real_samples = np.array([plt.imread(real_files[idx]) for idx in real_idx])
36
- generated_samples = generate(n_fake, generator)
37
  captcha_samples = np.concatenate((generated_samples, real_samples))
38
 
39
  captcha_idx = [x for x in range(len(captcha_samples))]
 
31
  return fig, fake_idx
32
 
33
  def get_challenge():
34
+ seed = random.randint(0, 1000)
35
  real_idx = np.random.randint(low=0, high=len(real_files), size=n_real)
36
  real_samples = np.array([plt.imread(real_files[idx]) for idx in real_idx])
37
+ generated_samples = generate(n_fake, generator, seed)
38
  captcha_samples = np.concatenate((generated_samples, real_samples))
39
 
40
  captcha_idx = [x for x in range(len(captcha_samples))]