Spaces:
Runtime error
Runtime error
Update gradio_demo.py
Browse files- gradio_demo.py +3 -3
gradio_demo.py
CHANGED
@@ -1174,8 +1174,7 @@ with block:
|
|
1174 |
with gr.Tab("Background", visible=True):
|
1175 |
# empty cache
|
1176 |
|
1177 |
-
mask_mover = MaskMover()
|
1178 |
-
|
1179 |
# with torch.no_grad():
|
1180 |
# # Update the input channels to 12
|
1181 |
# new_conv_in = torch.nn.Conv2d(12, unet.conv_in.out_channels, unet.conv_in.kernel_size, unet.conv_in.stride, unet.conv_in.padding) # Changed from 8 to 12
|
@@ -1358,7 +1357,8 @@ with block:
|
|
1358 |
return composite
|
1359 |
|
1360 |
# Create an instance of BackgroundManager
|
1361 |
-
bg_manager = BackgroundManager()
|
|
|
1362 |
|
1363 |
def update_position_wrapper(background, x_pos, y_pos, scale):
|
1364 |
return bg_manager.update_position(background, x_pos, y_pos, scale)
|
|
|
1174 |
with gr.Tab("Background", visible=True):
|
1175 |
# empty cache
|
1176 |
|
1177 |
+
mask_mover = gr.State(MaskMover())
|
|
|
1178 |
# with torch.no_grad():
|
1179 |
# # Update the input channels to 12
|
1180 |
# new_conv_in = torch.nn.Conv2d(12, unet.conv_in.out_channels, unet.conv_in.kernel_size, unet.conv_in.stride, unet.conv_in.padding) # Changed from 8 to 12
|
|
|
1357 |
return composite
|
1358 |
|
1359 |
# Create an instance of BackgroundManager
|
1360 |
+
# bg_manager = BackgroundManager()
|
1361 |
+
bg_manager = gr.State(BackgroundManager())
|
1362 |
|
1363 |
def update_position_wrapper(background, x_pos, y_pos, scale):
|
1364 |
return bg_manager.update_position(background, x_pos, y_pos, scale)
|