Spaces:
Paused
Paused
update with random seed
Browse files
app.py
CHANGED
@@ -8,8 +8,11 @@ import os
|
|
8 |
# BLIP-generated caption prompt is saved as output/test_cat/prompt/image-name.txt - eg., a painting of a cat sitting on top of a ball
|
9 |
def inversion(image_in): #, progress=gr.Progress(track_tqdm=True)):
|
10 |
#progress(0, desc="Starting...")
|
|
|
|
|
11 |
# saving the input image
|
12 |
-
image_in.save(
|
|
|
13 |
# Run the script file
|
14 |
subprocess.run(["python", "src/inversion.py", "--input_image", "input_image.png", "--results_folder", "output/test_cat"])
|
15 |
# Open the text file with blip caption
|
|
|
8 |
# BLIP-generated caption prompt is saved as output/test_cat/prompt/image-name.txt - eg., a painting of a cat sitting on top of a ball
|
9 |
def inversion(image_in): #, progress=gr.Progress(track_tqdm=True)):
|
10 |
#progress(0, desc="Starting...")
|
11 |
+
seed = random.randint(0, 1000000)
|
12 |
+
img_name = f"./input_image_{seed}.png"
|
13 |
# saving the input image
|
14 |
+
image_in.save(img_name)
|
15 |
+
#image_in.save("input_image.png") #("assets/test_images/cats/input_image.png")
|
16 |
# Run the script file
|
17 |
subprocess.run(["python", "src/inversion.py", "--input_image", "input_image.png", "--results_folder", "output/test_cat"])
|
18 |
# Open the text file with blip caption
|