Zhang Zelun 10 months ago
parent
commit
e914a7bd83
1 changed files with 2 additions and 0 deletions
  1. 2 0
      paddlex/inference/models_new/semantic_segmentation/result.py

+ 2 - 0
paddlex/inference/models_new/semantic_segmentation/result.py

@@ -26,6 +26,8 @@ class SegResult(BaseCVResult):
         """apply"""
         """apply"""
         seg_map = self["pred"]
         seg_map = self["pred"]
         pc_map = self.get_pseudo_color_map(seg_map[0])
         pc_map = self.get_pseudo_color_map(seg_map[0])
+        if pc_map.mode == "P":
+            pc_map = pc_map.convert("RGB")
         return pc_map
         return pc_map
 
 
     def get_pseudo_color_map(self, pred):
     def get_pseudo_color_map(self, pred):