Spaces:
Sleeping
Sleeping
Commit ·
2297983
1
Parent(s): c75e77a
overlay revised2
Browse files
app.py
CHANGED
|
@@ -365,7 +365,7 @@ with gr.Blocks(
|
|
| 365 |
return segmented_image_pil
|
| 366 |
|
| 367 |
# Overlay logic
|
| 368 |
-
seg_rgba_np = np.array(segmented_image_pil.convert("
|
| 369 |
input_L_np = np.array(original_lineart_pil.convert("L"))
|
| 370 |
|
| 371 |
# Normalize input_L_np to 0-1 and expand dims for broadcasting
|
|
@@ -373,7 +373,7 @@ with gr.Blocks(
|
|
| 373 |
|
| 374 |
# Modulate all channels of segmentation_rgba by the grayscale factor
|
| 375 |
overlay_np = (seg_rgba_np * factor).astype(np.uint8)
|
| 376 |
-
disp_segmented = Image.fromarray(overlay_np, '
|
| 377 |
|
| 378 |
return disp_segmented
|
| 379 |
else:
|
|
|
|
| 365 |
return segmented_image_pil
|
| 366 |
|
| 367 |
# Overlay logic
|
| 368 |
+
seg_rgba_np = np.array(segmented_image_pil.convert("RGB"))
|
| 369 |
input_L_np = np.array(original_lineart_pil.convert("L"))
|
| 370 |
|
| 371 |
# Normalize input_L_np to 0-1 and expand dims for broadcasting
|
|
|
|
| 373 |
|
| 374 |
# Modulate all channels of segmentation_rgba by the grayscale factor
|
| 375 |
overlay_np = (seg_rgba_np * factor).astype(np.uint8)
|
| 376 |
+
disp_segmented = Image.fromarray(overlay_np, 'RGB')
|
| 377 |
|
| 378 |
return disp_segmented
|
| 379 |
else:
|