yatengLG / ISAT_with_segment_anything

Labeling tool with SAM(segment anything model),supports SAM, SAM2, sam-hq, MobileSAM EdgeSAM etc.交互式半自动图像标注工具
https://www.yatenglg.cn/isat/
Other
1.33k stars 139 forks source link

通道数检测错误导致无法用sam模型 #201

Closed cskkx1 closed 3 months ago

cskkx1 commented 3 months ago

上传3通道的图片到程序,显示通道数为4,不能用sam模型

yatengLG commented 3 months ago

那肯定是你图片是4通道的。

用下面代码看通道吧。

import numpy as np
from PIL import Image

image_path = ""
image_data = np.array(Image.open(image_path))
print(image_data.shape)
yatengLG commented 3 months ago

想用sam处理你的图片,可以自行转换通道后再使用。

参考 https://github.com/yatengLG/ISAT_with_segment_anything/issues/202

cskkx1 commented 3 months ago

哦哦感谢,之前通道数确实有问题