ysharma HF staff commited on
Commit
23007d6
1 Parent(s): 5c7bc01

updated random seeding code

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -10,8 +10,8 @@ import random
10
  def inversion(image_in): #, progress=gr.Progress(track_tqdm=True)):
11
  #progress(0, desc="Starting...")
12
  seed = random.randint(0, 1000000)
13
- img_name = f"./input_image_{seed}.png"
14
- img_label = f"./input_image_{seed}"
15
  # saving the input image
16
  image_in.save(img_name)
17
  #image_in.save("input_image.png") #("assets/test_images/cats/input_image.png")
@@ -29,7 +29,7 @@ def inversion(image_in): #, progress=gr.Progress(track_tqdm=True)):
29
  def image_edit(task_name, seed): #, progress=gr.Progress(track_tqdm=True)):
30
  #progress(0, desc="Starting...")
31
  seed = int(seed)
32
- img_label = f"./input_image_{seed}"
33
  # Run the script file
34
  subprocess.run(["python", "src/edit_real.py", "--inversion", f"output/test_cat/inversion/{img_label}.pt",
35
  "--prompt", f"output/test_cat/prompt/{img_label}.txt", "--task_name", task_name,
 
10
  def inversion(image_in): #, progress=gr.Progress(track_tqdm=True)):
11
  #progress(0, desc="Starting...")
12
  seed = random.randint(0, 1000000)
13
+ img_name = f"input_image_{seed}.png"
14
+ img_label = f"input_image_{seed}"
15
  # saving the input image
16
  image_in.save(img_name)
17
  #image_in.save("input_image.png") #("assets/test_images/cats/input_image.png")
 
29
  def image_edit(task_name, seed): #, progress=gr.Progress(track_tqdm=True)):
30
  #progress(0, desc="Starting...")
31
  seed = int(seed)
32
+ img_label = f"input_image_{seed}"
33
  # Run the script file
34
  subprocess.run(["python", "src/edit_real.py", "--inversion", f"output/test_cat/inversion/{img_label}.pt",
35
  "--prompt", f"output/test_cat/prompt/{img_label}.txt", "--task_name", task_name,