Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -407,15 +407,16 @@ def run(state, drawpad):
|
|
407 |
tic = time.time()
|
408 |
while True:
|
409 |
# Receive real-time mask inputs from the main process.
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
|
|
419 |
|
420 |
yield [state, model()]
|
421 |
toc = time.time()
|
@@ -472,7 +473,12 @@ def draw(state, drawpad):
|
|
472 |
# mask_strength=mask_strengths[i],
|
473 |
# mask_std=mask_stds[i],
|
474 |
# )
|
475 |
-
|
|
|
|
|
|
|
|
|
|
|
476 |
conn.close()
|
477 |
|
478 |
### Load examples
|
|
|
407 |
tic = time.time()
|
408 |
while True:
|
409 |
# Receive real-time mask inputs from the main process.
|
410 |
+
data = conn.recv()
|
411 |
+
if data is not None:
|
412 |
+
print('Received data!!!')
|
413 |
+
for i in range(opt.max_palettes):
|
414 |
+
model.update_single_layer(
|
415 |
+
idx=i,
|
416 |
+
mask=data['masks'][i],
|
417 |
+
mask_strength=data['mask_strengths'][i],
|
418 |
+
mask_std=data['mask_stds'][i],
|
419 |
+
)
|
420 |
|
421 |
yield [state, model()]
|
422 |
toc = time.time()
|
|
|
473 |
# mask_strength=mask_strengths[i],
|
474 |
# mask_std=mask_stds[i],
|
475 |
# )
|
476 |
+
data = dict(
|
477 |
+
masks=masks,
|
478 |
+
mask_strengths=mask_strengths,
|
479 |
+
mask_stds=mask_stds,
|
480 |
+
)
|
481 |
+
conn.send(data)
|
482 |
conn.close()
|
483 |
|
484 |
### Load examples
|