Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ from src.pix2pix_turbo import Pix2Pix_Turbo
|
|
17 |
|
18 |
model = Pix2Pix_Turbo("sketch_to_image_stochastic")
|
19 |
|
20 |
-
ITEMS_NAMES = [ "π‘ Lamp","π Bag","ποΈ Sofa","πͺ Chair","ποΈ Car","ποΈ Motorbike","π Building"
|
21 |
MAX_SEED = np.iinfo(np.int32).max
|
22 |
DEFAULT_ITEM_NAME = "π‘ Lamp"
|
23 |
|
@@ -44,7 +44,7 @@ def run(image, item_name):
|
|
44 |
torch.manual_seed(42)
|
45 |
B,C,H,W = c_t.shape
|
46 |
noise = torch.randn((1,4,H//8, W//8), device=c_t.device)
|
47 |
-
output_image = model(c_t, prompt, deterministic=False, r=0.
|
48 |
output_pil = TF.to_pil_image(output_image[0].cpu()*0.5+0.5)
|
49 |
input_sketch_uri = pil_image_to_data_uri(Image.fromarray(255-np.array(image)))
|
50 |
output_image_uri = pil_image_to_data_uri(output_pil)
|
|
|
17 |
|
18 |
model = Pix2Pix_Turbo("sketch_to_image_stochastic")
|
19 |
|
20 |
+
ITEMS_NAMES = [ "π‘ Lamp","π Bag","ποΈ Sofa","πͺ Chair","ποΈ Car","ποΈ Motorbike","π Building"]
|
21 |
MAX_SEED = np.iinfo(np.int32).max
|
22 |
DEFAULT_ITEM_NAME = "π‘ Lamp"
|
23 |
|
|
|
44 |
torch.manual_seed(42)
|
45 |
B,C,H,W = c_t.shape
|
46 |
noise = torch.randn((1,4,H//8, W//8), device=c_t.device)
|
47 |
+
output_image = model(c_t, prompt, deterministic=False, r=0.4, noise_map=noise)
|
48 |
output_pil = TF.to_pil_image(output_image[0].cpu()*0.5+0.5)
|
49 |
input_sketch_uri = pil_image_to_data_uri(Image.fromarray(255-np.array(image)))
|
50 |
output_image_uri = pil_image_to_data_uri(output_pil)
|