Spaces:
Running
Running
new photos
Browse files- .gitignore +0 -6
- app.py +1 -1
- examples/scribbles/more_purple.png +0 -0
- examples/scribbles/more_red.png +0 -0
- examples/scribbles/test_purple_scarf.png +0 -0
- examples/scribbles/test_red_scarf.png +0 -0
- load_model.py +6 -2
- results/sample.png +0 -0
.gitignore
CHANGED
@@ -1,7 +1,3 @@
|
|
1 |
-
#.model.pth
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
# Byte-compiled / optimized / DLL files
|
6 |
__pycache__/
|
7 |
*.py[cod]
|
@@ -28,10 +24,8 @@ wandb/
|
|
28 |
|
29 |
|
30 |
.vscode/
|
31 |
-
https://github.com/higumax/sketchKeras-pytorch.git
|
32 |
|
33 |
.startup.sh
|
34 |
-
|
35 |
startup.sh
|
36 |
|
37 |
|
|
|
|
|
|
|
|
|
|
|
1 |
# Byte-compiled / optimized / DLL files
|
2 |
__pycache__/
|
3 |
*.py[cod]
|
|
|
24 |
|
25 |
|
26 |
.vscode/
|
|
|
27 |
|
28 |
.startup.sh
|
|
|
29 |
startup.sh
|
30 |
|
31 |
|
app.py
CHANGED
@@ -82,7 +82,7 @@ with gr.Blocks(theme=theme) as demo:
|
|
82 |
with gr.Column():
|
83 |
seed_slider = gr.Number(
|
84 |
label="Random Seed π² (if the image generated is not to your liking, simply use another seed)",
|
85 |
-
value=
|
86 |
)
|
87 |
|
88 |
upscale_button = gr.Checkbox(
|
|
|
82 |
with gr.Column():
|
83 |
seed_slider = gr.Number(
|
84 |
label="Random Seed π² (if the image generated is not to your liking, simply use another seed)",
|
85 |
+
value=5,
|
86 |
)
|
87 |
|
88 |
upscale_button = gr.Checkbox(
|
examples/scribbles/more_purple.png
ADDED
![]() |
examples/scribbles/more_red.png
ADDED
![]() |
examples/scribbles/test_purple_scarf.png
DELETED
Binary file (96 kB)
|
|
examples/scribbles/test_red_scarf.png
DELETED
Binary file (95.8 kB)
|
|
load_model.py
CHANGED
@@ -83,7 +83,7 @@ def sample(sketch, scribbles, sampling_steps, seed_nr, progress):
|
|
83 |
|
84 |
for t in progress.tqdm(
|
85 |
noise_scheduler.timesteps,
|
86 |
-
desc="
|
87 |
):
|
88 |
noise_for_plain = noise_scheduler.scale_model_input(noise_for_plain, t).to(
|
89 |
device
|
@@ -110,4 +110,8 @@ def sample(sketch, scribbles, sampling_steps, seed_nr, progress):
|
|
110 |
|
111 |
sample = torch.clamp((noise_for_plain / 2) + 0.5, 0, 1)
|
112 |
|
113 |
-
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
for t in progress.tqdm(
|
85 |
noise_scheduler.timesteps,
|
86 |
+
desc="Painting πππ",
|
87 |
):
|
88 |
noise_for_plain = noise_scheduler.scale_model_input(noise_for_plain, t).to(
|
89 |
device
|
|
|
110 |
|
111 |
sample = torch.clamp((noise_for_plain / 2) + 0.5, 0, 1)
|
112 |
|
113 |
+
image = transforms.ToPILImage()(sample[0].cpu())
|
114 |
+
|
115 |
+
image.save("results/sample.png")
|
116 |
+
|
117 |
+
return image
|
results/sample.png
ADDED
![]() |