Spaces:
Sleeping
Sleeping
Commit ·
fa09dc1
1
Parent(s): 990b65c
fix: import correct module
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio
|
| 2 |
import numpy
|
| 3 |
|
| 4 |
-
from matplotlib import
|
| 5 |
from pathlib import Path
|
| 6 |
from PIL import Image
|
| 7 |
|
|
@@ -48,7 +48,7 @@ def segment_image(image):
|
|
| 48 |
|
| 49 |
prediction_array = numpy.array(prediction, dtype=numpy.uint8)
|
| 50 |
|
| 51 |
-
colormap =
|
| 52 |
prediction_array) + 1)
|
| 53 |
colored_mask = colormap(prediction_array)[:, :, :3]
|
| 54 |
|
|
|
|
| 1 |
import gradio
|
| 2 |
import numpy
|
| 3 |
|
| 4 |
+
from matplotlib import cm
|
| 5 |
from pathlib import Path
|
| 6 |
from PIL import Image
|
| 7 |
|
|
|
|
| 48 |
|
| 49 |
prediction_array = numpy.array(prediction, dtype=numpy.uint8)
|
| 50 |
|
| 51 |
+
colormap = cm.get_cmap('jet', numpy.max(
|
| 52 |
prediction_array) + 1)
|
| 53 |
colored_mask = colormap(prediction_array)[:, :, :3]
|
| 54 |
|